Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
19223db1
Commit
19223db1
authored
Aug 28, 2020
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preload projects to prevent N+1 when populating project name
parent
0e0c7376
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
app/models/ci/daily_build_group_report_result.rb
app/models/ci/daily_build_group_report_result.rb
+2
-0
changelogs/unreleased/improve-group-coverage-query-performance.yml
...s/unreleased/improve-group-coverage-query-performance.yml
+5
-0
ee/app/finders/ci/daily_build_group_report_results_by_group_finder.rb
...rs/ci/daily_build_group_report_results_by_group_finder.rb
+4
-0
No files found.
app/models/ci/daily_build_group_report_result.rb
View file @
19223db1
...
...
@@ -11,6 +11,8 @@ module Ci
validates
:data
,
json_schema:
{
filename:
"daily_build_group_report_result_data"
}
scope
:with_preloaded_projects
,
->
{
preload
(
:project
)
}
def
self
.
upsert_reports
(
data
)
upsert_all
(
data
,
unique_by: :index_daily_build_group_report_results_unique_columns
)
if
data
.
any?
end
...
...
changelogs/unreleased/improve-group-coverage-query-performance.yml
0 → 100644
View file @
19223db1
---
title
:
Preload projects to prevent N+1 when populating project name
merge_request
:
40769
author
:
type
:
performance
ee/app/finders/ci/daily_build_group_report_results_by_group_finder.rb
View file @
19223db1
...
...
@@ -19,6 +19,10 @@ module Ci
private
def
query
super
.
with_preloaded_projects
end
def
query_allowed?
can?
(
current_user
,
:read_group_build_report_results
,
@group
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment