Repository navigation
Conversation
shivaam
marked this pull request as ready for review
October 20, 2026 16:43
Member
|
Also paging experts on this @dstandish @seanmuth |
dstandish
approved these changes
Oct 28, 2026
shivaam
force-pushed
the
fix-callback-trigger-id-index
branch
from
October 28, 2026 21:24
77bda8c to
c771613
Compare
1 task done
1 task done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trigger cleanup checks
callback.trigger_idbefore deleting an unreferenced trigger. Unlike theequivalent task-instance and asset-watcher columns, this callback column has no explicit Airflow
index on PostgreSQL or SQLite, so those checks can scan the callback table.
This is a follow-up to #70961, where the missing
callback.trigger_idindex was left as separatework.
This adds a non-unique
idx_callback_trigger_idindex. PostgreSQL and SQLite use a partial indexcontaining only non-null trigger references. MySQL uses a full index because it does not support
equivalent partial indexes; InnoDB already creates an index for the foreign key, so the migration
standardizes its name without adding a duplicate index.
The column remains nullable and non-unique. Callback lifecycle and trigger-cleanup SQL are
unchanged.
In a local PostgreSQL benchmark with one million callback rows and one percent non-null references,
the cleanup query improved from 12.1 seconds without an index to about 7.9 milliseconds with either
indexed shape. The partial index was about 29 times smaller than the full index (240 KiB versus 6.8
MiB).
Testing performed:
preksuiteTrade-offs:
or changed.
CREATE INDEX, consistent with existing Airflow migrations, so itmay temporarily block conflicting writes while the index is created.
related: #68243
Was generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-5) and Claude Code (Opus 5.5) following the guidelines