Repository navigation
UI: Fix slow pending Dag run checks on large databases - #75674
Merged
Merged
Conversation
yuseok89
marked this pull request as ready for review
October 26, 2026 23:44
yuseok89
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
October 26, 2026 23:44
bbovenzi
approved these changes
Oct 27, 2026
Contributor
Backport successfully created: v3-4-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
bbovenzi
pushed a commit
that referenced
this pull request
Oct 27, 2026
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.
The dashboard polls for running or queued Dag runs to decide whether to auto-refresh, every 3 seconds while runs are active. The check fetched one Dag run ordered by id. When the statistics from the last ANALYZE count some pending runs, Postgres serves that by scanning
dag_runby primary key from the oldest run, and since pending runs are the newest it reads nearly the whole table. Only the count is used, so the check now asks for no rows and readstotal_entries.Measured on Postgres with 5M finished runs, through the real endpoint.
limit=1)limit=0)The new test serves the endpoint from an msw handler that returns only
limitrows with the full count intotal_entries, as the API does. It checks that refresh still turns on and that every request asks forlimit=0, and it fails on main.Was generative AI tooling used to co-author this PR?
{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.