Commit 330b4bd8 authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch 'fix-n+1-for-project-scope' into 'master'

Preload group.parent for project scope searches

See merge request gitlab-org/gitlab!57277
parents 344d8cd6 cad6bb36
...@@ -623,7 +623,7 @@ class Project < ApplicationRecord ...@@ -623,7 +623,7 @@ class Project < ApplicationRecord
end end
def self.with_web_entity_associations def self.with_web_entity_associations
preload(:project_feature, :route, :creator, :group, namespace: [:route, :owner]) preload(:project_feature, :route, :creator, group: :parent, namespace: [:route, :owner])
end end
def self.eager_load_namespace_and_owner def self.eager_load_namespace_and_owner
......
---
title: Preload group parent to fix N+1 queries for project search
merge_request: 57277
author:
type: performance
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment