Skip to content

Add indexes on task_instance.dag_version_id and dag_run.created_dag_version_id#64818

Open
justinpakzad wants to merge 3 commits intoapache:mainfrom
justinpakzad:add-idxs-to-ti-and-dr
Open

Add indexes on task_instance.dag_version_id and dag_run.created_dag_version_id#64818
justinpakzad wants to merge 3 commits intoapache:mainfrom
justinpakzad:add-idxs-to-ti-and-dr

Conversation

@justinpakzad
Copy link
Copy Markdown
Contributor


Added indexes on task_instance.dag_version_id and dag_run.created_dag_version_id. This should prevent sequential scans when running command such as airflow db clean -t dag_version --clean-before-timestamp 2025-12-31.

closes: #60145

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, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@justinpakzad justinpakzad force-pushed the add-idxs-to-ti-and-dr branch from d9267e2 to 700efb3 Compare April 7, 2026 02:03
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.

Possible missing indices on the database tables task_instance and dag_run

1 participant