Eliminate N+1 queries in loading namespaces for every issuable in milestones
If we rely on the helper functions in GitlabRoutingHelper
for merge_request_path
,
we end up calling a database query to look up the Namespace association for
every merge request since entity.project.namespace
is called. By reusing the project
defined in the controller, we avoid that problem.
Partial fix to #27387 (closed)
Merge request reports
Activity
mentioned in issue #27387 (closed)
- Resolved by Stan Hu
@stanhu thanks, good catch! One question.
assigned to @stanhu
added 1 commit
- f081e781 - Optimize project namespace lookup for milestones and add specs
mentioned in merge request !10872 (merged)
added 1 commit
- 68bb2a53 - Optimize project namespace lookup for milestones and add specs
assigned to @smcgivern
enabled an automatic merge when the pipeline for 68bb2a53 succeeds
mentioned in commit 3ac4ef22
mentioned in commit 3e40fb27
mentioned in issue #31285 (closed)
mentioned in merge request !12670 (merged)