Skip to content

N+1 Queries on Issues#index

Each of the 20 issues per page on Projects::IssuesController#index triggers an award_emoji lookup. I think it also loads labels with N+1 queries, but haven't checked this in a while.

In order to prevent a regression we should also add a test using the QueryRecorder from https://gitlab.com/gitlab-org/gitlab-ce/commit/9c623e3e5d7434f2e30f7c389d13e5af4ede770a

Example query

SELECT COUNT(*) FROM "award_emoji"