Fix N+1 in projects REST endpoint and forked projects
What does this MR do?
When retrieve projects from the /projects
REST endpoint and there are several forked projects, some N+1 are present. In this MR we fix the N+1 in the namespace
, project_features
, and users
field of forked projects.
Before the MR, the namespace for forked projects behaved like this:
With the preload of that relation, the new query is:
The project_features
relation also behaved badly formerly:
With the preload:
Lastly, the users
also presented an N+1 when trying to render the avatar url:
But now with the preload:
Does this MR meet the acceptance criteria?
Conformity
-
Does this MR need a changelog?-
I have included a changelog entry.
-
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Related to #21121 (closed)
Merge request reports
Activity
changed milestone to %13.11
added 1 commit
- 8b925277 - Fix N+1 in projects REST endpoint and forked projects
- Resolved by Sincheol (David) Kim
added databasereview pending label
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
Category Reviewer Maintainer backend Terri Chu ( @terrichu
) (UTC-4, 6 hours behind@fjsanpedro
)Mikołaj Wawrzyniak ( @mikolaj_wawrzyniak
) (UTC+2, same timezone as@fjsanpedro
)database Mehmet Emin Inac ( @minac
) (UTC+2, same timezone as@fjsanpedro
)Tiger Watson ( @tigerwnz
) (UTC+13, 11 hours ahead of@fjsanpedro
)If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerEdited by 🤖 GitLab Bot 🤖marked the checklist item Code review guidelines as completed
marked the checklist item Merge request performance guidelines as completed
marked the checklist item Database guides as completed
marked the checklist item Style guides as completed
marked the checklist item Separation of EE specific content as completed
- Resolved by Sincheol (David) Kim
requested review from @terrichu
requested review from @alexives
removed review request for @alexives
- Resolved by Francisco Javier López
requested review from @alexives
added databasereviewed label and removed databasereview pending label
requested review from @tigerwnz
added typemaintenance label
added typefeature label
requested review from @dskim_gitlab and removed review request for @terrichu
mentioned in issue gitlab-com/www-gitlab-com#9656 (closed)
added databaseapproved label and removed databasereviewed label
added 239 commits
-
8b925277...a569f9c0 - 238 commits from branch
master
- 898b95a1 - Fix N+1 in projects REST endpoint and forked projects
-
8b925277...a569f9c0 - 238 commits from branch
mentioned in issue gitlab-com/www-gitlab-com#5437 (closed)
Setting label(s) devopscreate sectiondev based on ~"group::editor".
added devopscreate sectiondev labels
removed review request for @dskim_gitlab
added 315 commits
-
898b95a1...f043ace9 - 314 commits from branch
master
- 8d7bcb8f - Fix N+1 in projects REST endpoint and forked projects
-
898b95a1...f043ace9 - 314 commits from branch
requested review from @dskim_gitlab
enabled an automatic merge when the pipeline for 4ff2aa18 succeeds
mentioned in commit c624b1e0
added workflowstaging label and removed workflowin dev label
added workflowcanary label and removed workflowstaging label
mentioned in issue create-stage#12819 (closed)
added workflowproduction label and removed workflowcanary label
added releasedcandidate label
removed typefeature label