Skip to content

perf(incidents): Avoid N+1 in WorkflowEngineIncidentSerializer#113009

Merged
kcons merged 2 commits intomasterfrom
kcons/nplus
Apr 15, 2026
Merged

perf(incidents): Avoid N+1 in WorkflowEngineIncidentSerializer#113009
kcons merged 2 commits intomasterfrom
kcons/nplus

Conversation

@kcons
Copy link
Copy Markdown
Member

@kcons kcons commented Apr 14, 2026

We should be doing our querying in batches in get_attrs, not in serialize.

@kcons kcons requested a review from a team as a code owner April 14, 2026 23:46
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 14, 2026
Comment thread src/sentry/incidents/endpoints/serializers/workflow_engine_incident.py Outdated
Comment thread src/sentry/incidents/endpoints/serializers/workflow_engine_incident.py Outdated
Copy link
Copy Markdown
Member

@ceorourke ceorourke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm though the bot might be onto something

incident_id = get_fake_id_from_object_id(obj.id)
incident_identifier = incident_id
incident_id = attrs["incident_id"]
incident_identifier = attrs["incident_identifier"]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden's complaint here isn't entirely invalid, but it is no different than the behavior before this change. I think we're ok with it.

@kcons kcons merged commit 04eb17a into master Apr 15, 2026
56 checks passed
@kcons kcons deleted the kcons/nplus branch April 15, 2026 17:06
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.

3 participants