Commit 2fdd8982 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'sh-fix-issue-api-perf-n-plus-one' into 'master'

Eliminate cached N+1 queries for projects in Issue API

See merge request gitlab-org/gitlab-ce!19269
parents a53a0487 ef253a1e
---
title: Eliminate cached N+1 queries for projects in Issue API
merge_request:
author:
type: performance
...@@ -16,7 +16,7 @@ module API ...@@ -16,7 +16,7 @@ module API
args[:scope] = args[:scope].underscore if args[:scope] args[:scope] = args[:scope].underscore if args[:scope]
issues = IssuesFinder.new(current_user, args).execute issues = IssuesFinder.new(current_user, args).execute
.preload(:assignees, :labels, :notes, :timelogs) .preload(:assignees, :labels, :notes, :timelogs, :project)
issues.reorder(args[:order_by] => args[:sort]) issues.reorder(args[:order_by] => args[:sort])
end end
......
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