Skip to content

Improve page load performance of new merge request page by eliminating N+1 queries

What does this MR do?

Eager loads route and namespace to avoid N+1 queries while generating Target Project list.

It seems that loading all forked projects is a bit too wasteful especially for a popular project like gitlab. I'd like us to consider revisiting the UX for this to load the list only when necessary, but I'd like to keep this MR small.

It would reduce the number of queries, but I'm not too sure how it would perform with thousands of forked projects. Do we have a way to test something like this?

Screenshots

Example new merge request page:

Screen_Shot_2019-12-06_at_5.23.47_pm

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #21087 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports