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)
Edited by Francisco Javier López