Skip to content

Commit c30a91e

Browse files
authored
db: Remove JOIN between GroupTagKey and TagKey (#6077)
Fixes SENTRY-4GZ
1 parent 9454a03 commit c30a91e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sentry/api/endpoints/group_tags.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212

1313
class GroupTagsEndpoint(GroupEndpoint):
1414
def get(self, request, group):
15+
grouptagkeys = list(GroupTagKey.objects.filter(
16+
group_id=group.id
17+
).values_list('key', flat=True))
18+
1519
tag_keys = TagKey.objects.filter(
1620
project_id=group.project_id,
1721
status=TagKeyStatus.VISIBLE,
18-
key__in=GroupTagKey.objects.filter(
19-
group_id=group.id,
20-
).values('key'),
22+
key__in=grouptagkeys,
2123
)
2224

2325
# O(N) db access

0 commit comments

Comments
 (0)