Skip to content

perf(issues): Reuse the group when fetching escalation forecasts - #127719

Draft
scttcper wants to merge 1 commit into
masterfrom
scttcper/reuse-group-escalation-forecast
Draft

scttcper wants to merge 1 commit into
masterfrom
scttcper/reuse-group-escalation-forecast

Conversation

@scttcper

@scttcper scttcper commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Avoid reloading the group just to check should_detect_escalation() when fetching an escalation forecast, both callers already have it. The lookup was left over from when the check took an organization behind a flag (#70443).

This runs for events on issues archived until escalating, roughly 30M times a week in post_process at ~2ms p50, around 17 hours of db time a week (ballpark, only a few sampled spans). Example trace, the sentry_groupedmessage select under process_snoozes is the one that goes away.

EscalatingGroupForecast.fetch only took ids, so it reloaded the Group from the db just to check should_detect_escalation(). That lookup was needed when the check took an organization behind a feature flag, the flag and org query were removed in #70443 but the group query stayed. Both callers already have the group, pass it through instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant