Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-12-07 16:51:45 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2017-12-08 14:33:51 +0300
commitc52a36e85959a5461b74bae8f881043a4e4feb45 (patch)
tree2001569f9df252a9277b31d609bb255b010fe874 /changelogs
parent9429e8ac60a10436a0469d7d206d3f74a2c966c7 (diff)
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.
Diffstat (limited to 'changelogs')
-rw-r--r--changelogs/unreleased/fix-event-target-author-preloading.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/fix-event-target-author-preloading.yml b/changelogs/unreleased/fix-event-target-author-preloading.yml
new file mode 100644
index 00000000000..c6154cc0835
--- /dev/null
+++ b/changelogs/unreleased/fix-event-target-author-preloading.yml
@@ -0,0 +1,5 @@
+---
+title: Fix N+1 query when displaying events
+merge_request:
+author:
+type: performance