Skip to content
Snippets Groups Projects

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:

namespaces_ANTERIOR

With the preload of that relation, the new query is:

Namespaces_DESPUES

The project_features relation also behaved badly formerly:

project_features_ANTERIOR

With the preload:

Project_features_DESPUES

Lastly, the users also presented an N+1 when trying to render the avatar url:

users_ANTERIOR

But now with the preload:

users_DESPUES

Does this MR meet the acceptance criteria?

Conformity

Related to #21121 (closed)

Edited by Francisco Javier López

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
  • 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 :no_entry_sign: Danger

    Edited by 🤖 GitLab Bot 🤖
  • Francisco Javier López marked the checklist item I have included a changelog entry. as completed

    marked the checklist item I have included a changelog entry. as completed

  • Francisco Javier López marked the checklist item Code review guidelines as completed

    marked the checklist item Code review guidelines as completed

  • marked the checklist item Merge request performance guidelines as completed

  • Francisco Javier López marked the checklist item Database guides as completed

    marked the checklist item Database guides as completed

  • Francisco Javier López marked the checklist item Style guides as completed

    marked the checklist item Style guides as completed

  • marked the checklist item Separation of EE specific content as completed

  • requested review from @terrichu

  • requested review from @alexives

  • Alex Ives removed review request for @alexives

    removed review request for @alexives

  • Alex Ives
  • requested review from @alexives

  • Alex Ives approved this merge request

    approved this merge request

  • added databasereviewed label and removed databasereview pending label

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading