Skip to content
Snippets Groups Projects

Eliminate N+1 queries in loading namespaces for every issuable in milestones

Merged Stan Hu requested to merge sh-optimize-milestone-polymorphic-url into master
All threads resolved!

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @stanhu thanks, good catch! One question.

  • Stan Hu added 1 commit

    added 1 commit

    • f081e781 - Optimize project namespace lookup for milestones and add specs

    Compare with previous version

  • Stan Hu mentioned in merge request !10872 (merged)

    mentioned in merge request !10872 (merged)

  • Stan Hu resolved all discussions

    resolved all discussions

  • Stan Hu added 1 commit

    added 1 commit

    • 68bb2a53 - Optimize project namespace lookup for milestones and add specs

    Compare with previous version

  • assigned to @smcgivern

  • username-removed-443319 approved this merge request

    approved this merge request

  • username-removed-443319 enabled an automatic merge when the pipeline for 68bb2a53 succeeds

    enabled an automatic merge when the pipeline for 68bb2a53 succeeds

  • mentioned in commit 3ac4ef22

  • mentioned in commit 3e40fb27

  • Picked into 9-1-stable, will go into 9.1.1.

  • mentioned in merge request !12670 (merged)

  • Please register or sign in to reply
    Loading