Commit 86d8e294 authored by allison.browne's avatar allison.browne

Fix N+1 issue by using eager_load

parent d6ab58e1
......@@ -13,7 +13,8 @@ module Gitlab
Issue.class_eval { include EachBatch } unless Issue < EachBatch
count = 0
Issue.each_batch do |issue_batch|
Issue.eager_load(project: :grafana_integration).each_batch do |issue_batch|
embed_count_per_batch = issue_batch.map do |issue|
has_grafana_url?(issue)
end.count(&:itself)
......
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