Skip to content

Commit 464c28b

Browse files
authored
perf(aci): Cache Group lookup for process_workflows/trigger_action (#99449)
For process_workflows_event, querying for Group is one of the primary required queries. It's frequently very fast (~1ms), but at times we've observed it taking 100ms or more. Perhaps more significantly, querying for Group by ID is the most common query the app does, and we're part of htat. Given that this task runs after post_process, which does read Group through the cache, the Group we're processing should nearly always be in the cache, so here we expect a very high hit rate, a significant reduction in query volume to the database, and improvement in some of our wost case task latency.
1 parent 9bd81f7 commit 464c28b

File tree

1 file changed

+2
-2
lines changed
  • src/sentry/workflow_engine/tasks

1 file changed

+2
-2
lines changed

src/sentry/workflow_engine/tasks/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def build_workflow_event_data_from_event(
8282
raise EventNotFoundError(event_id, project_id)
8383

8484
occurrence = IssueOccurrence.fetch(occurrence_id, project_id) if occurrence_id else None
85-
# TODO(iamrajjoshi): Should we use get_from_cache here?
86-
group = Group.objects.get(id=group_id)
85+
86+
group = Group.objects.get_from_cache(id=group_id)
8787
group_event = GroupEvent.from_event(event, group)
8888
group_event.occurrence = occurrence
8989

0 commit comments

Comments
 (0)