Commit 9b017803 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'faster-label-transfer-queries' into 'master'

Remove unindexed condition on label transfer

See merge request gitlab-org/gitlab!37060
parents ad649e9c 274f7957
...@@ -53,7 +53,7 @@ module Labels ...@@ -53,7 +53,7 @@ module Labels
@group_labels_applied_to_issues ||= Label.joins(:issues) @group_labels_applied_to_issues ||= Label.joins(:issues)
.where( .where(
issues: { project_id: project.id }, issues: { project_id: project.id },
labels: { type: 'GroupLabel', group_id: old_group.self_and_ancestors } labels: { group_id: old_group.self_and_ancestors }
) )
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
...@@ -63,7 +63,7 @@ module Labels ...@@ -63,7 +63,7 @@ module Labels
@group_labels_applied_to_merge_requests ||= Label.joins(:merge_requests) @group_labels_applied_to_merge_requests ||= Label.joins(:merge_requests)
.where( .where(
merge_requests: { target_project_id: project.id }, merge_requests: { target_project_id: project.id },
labels: { type: 'GroupLabel', group_id: old_group.self_and_ancestors } labels: { group_id: old_group.self_and_ancestors }
) )
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
---
title: Remove unindexed condition on label transfer
merge_request: 37060
author:
type: performance
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