Skip to content

Change default sort to 'id' for list task instances#64168

Merged
pierrejeambrun merged 1 commit intoapache:mainfrom
astronomer:issue-62027-optimize-get-task-instances
Mar 25, 2026
Merged

Change default sort to 'id' for list task instances#64168
pierrejeambrun merged 1 commit intoapache:mainfrom
astronomer:issue-62027-optimize-get-task-instances

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun commented Mar 24, 2026

For performance reason change the default sort for TIs to "-id".

Also TI ids is a UUID7 which is 'time ordered'. This means that 'recent' tasks will be first in the table which is similar in behavior.

related: #62027

On the other hand this allows to leverage the index.

###Benchmark:

With 8M TIs, default query is now taking 2/2.5 seconds against 10+s before:

Before

Screenshot 2026-03-24 at 16 51 33

After

Screenshot 2026-03-24 at 16 50 30
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.

@pierrejeambrun pierrejeambrun added this to the Airflow 3.2.1 milestone Mar 24, 2026
@pierrejeambrun pierrejeambrun self-assigned this Mar 24, 2026
@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 24, 2026
@pierrejeambrun pierrejeambrun merged commit e7ea925 into apache:main Mar 25, 2026
153 of 154 checks passed
@pierrejeambrun pierrejeambrun deleted the issue-62027-optimize-get-task-instances branch March 25, 2026 11:48
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Mar 30, 2026
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants