Commit 588c7e45 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Alper Akgun

Use joins instead of includes

parent 4b4000de
......@@ -525,7 +525,9 @@ module EE
min_id = minimum_id(::Integrations::JiraTrackerData.where(issues_enabled: true), :service_id)
max_id = maximum_id(::Integrations::JiraTrackerData.where(issues_enabled: true), :service_id)
# rubocop: enable UsageData/LargeTable:
count(::Integrations::Jira.active.includes(:jira_tracker_data).where(jira_tracker_data: { issues_enabled: true }), start: min_id, finish: max_id)
# rubocop: disable UsageData/DistinctCountByLargeForeignKey
distinct_count(::Integrations::Jira.active.left_outer_joins(:jira_tracker_data).where(jira_tracker_data: { issues_enabled: true }), start: min_id, finish: max_id)
# rubocop: enable UsageData/DistinctCountByLargeForeignKey
end
# rubocop:enable CodeReuse/ActiveRecord
......
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