Improve page load performance of new merge request page by eliminating N+1 queries
requested to merge 21087-controller-projects-mergerequests-creationscontroller-new-executes-more-than-100-sql-queries into master
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:
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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 🤖