Skip to content

Conversation

@guan404ming
Copy link
Member

Related Issue

Closes #60895

Why

Deleting task instances is extremely slow (67+ seconds per row) because the ti_id foreign key column lacks an index. PostgreSQL performs sequential scans on task_reschedule when checking the FK constraint during cascading deletes.

How

Add index idx_task_reschedule_ti_id on task_reschedule(ti_id)


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@guan404ming guan404ming force-pushed the fix-task-reschedule-ti-id-index branch from e5abe39 to 2d0b3be Compare January 22, 2026 09:15
@guan404ming guan404ming marked this pull request as ready for review January 22, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing index on task_reschedule(ti_id)

1 participant