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
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-04-19 08:02:04 +0300
committerStan Hu <stanhu@gmail.com>2018-04-19 08:04:22 +0300
commit775211bc7076bba14d6e268fb324391124a2751f (patch)
tree0de01c4d207929f79628b5b1109452a91f4d2ba7 /app
parentd66f1882ffc5780723bbb38593aac9db590c6efe (diff)
Fix N+1 queries when loading participants for a commit note
We saw about 10,000 SQL queries for some commits in the NewNoteWorker, which stalled the Sidekiq queue for other new notes. The notification service took up to 8 minutes to process the commits. Avoiding this N+1 query brings the time down significantly. Closes #45526
Diffstat (limited to 'app')
-rw-r--r--app/models/commit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index de860df4b9c..9750e9298ec 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -248,7 +248,7 @@ class Commit
end
def notes_with_associations
- notes.includes(:author)
+ notes.includes(:author, :award_emoji)
end
def merge_requests