gitlab-org--gitlab-foss/changelogs/unreleased/fix-event-target-author-preloading.yml
Yorick Peterse c52a36e859
Fix N+1 query when displaying events
When displaying events we would load the target of those events, then
render the entire data using our Markdown pipeline. This pipeline would
eventually request the author of every target, leading to an additional
query being executed for every target to get the author.

To fix this we now eager load the author of the event's target. In my
local environment this reduces the number of queries to display a
project's Atom feed from 40 to 24 queries.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/36878 for more
information.
2017-12-08 12:33:51 +01:00

5 lines
89 B
YAML

---
title: Fix N+1 query when displaying events
merge_request:
author:
type: performance