Skip to content

Add indexes on serialized_dag and dag_code#69391

Open
justinpakzad wants to merge 1 commit into
apache:mainfrom
justinpakzad:add-indexes-ser-dag-dag-code
Open

Add indexes on serialized_dag and dag_code#69391
justinpakzad wants to merge 1 commit into
apache:mainfrom
justinpakzad:add-indexes-ser-dag-dag-code

Conversation

@justinpakzad

@justinpakzad justinpakzad commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds indexes on the dag_id columns of the serialized_dag and dag_code tables. This should avoid full table scans when fetching the latest serialized Dag or Dag code by dag_id.

Note - this a continuation of #64311, which was closed due to inactivity. Thanks to the author for the original implementation.

closes: #60883

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 marked this pull request as ready for review July 5, 2026 12:26
down_revision = "d2f4e1b3c5a7"
branch_labels = None
depends_on = None
airflow_version = "3.4.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@vatsrahul1001 Think this is worth including in 3.3.1?

@justinpakzad is the answer is yes then it would be easier if you could update this pr to use 3.3.1 as the version

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid full table scan on /structure/{dag_id}

2 participants