Eager load namespace owners for project dashboards
This solves an N+1 query problem where we'd run multiple queries when getting the namespace owners of the displayed projects.
This commit is contained in:
parent
5cc140b202
commit
615ba0071a
|
@ -48,7 +48,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
|
|||
ProjectsFinder
|
||||
.new(params: finder_params, current_user: current_user)
|
||||
.execute
|
||||
.includes(:route, :creator, namespace: :route)
|
||||
.includes(:route, :creator, namespace: [:route, :owner])
|
||||
end
|
||||
|
||||
def load_events
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Eager load namespace owners for project dashboards
|
||||
merge_request:
|
||||
author:
|
||||
type: other
|
Loading…
Reference in New Issue