Skip to content

Handle DB Performance Issues by Adding a New Index for Trigger - #69038

Merged
kaxil merged 1 commit into
apache:mainfrom
boschglobal:feature/add-index-for-trigger
Aug 10, 2026
Merged

kaxil merged 1 commit into
apache:mainfrom
boschglobal:feature/add-index-for-trigger

Conversation

@AutomationDev85

@AutomationDev85 AutomationDev85 commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Overview

We are currently using Airflow 3.2.2 and have run into the following issue:

We operate an Airflow instance with 45 triggerers, and our database reached 100% CPU utilization. We identified that the high load was caused by two queries originating from the trigger model:

The high CPU load occurred because these queries resulted in full table scans. To address this, we added the following index:

  • CREATE INDEX idx_trigger_triggerer_queue_id ON public.trigger USING btree (triggerer_id, queue, id)

CPU utilization dropped immediately after adding the index.

What do you think about this solution? I’m looking forward to your feedback.

Details of change:

  • Add index to solve DB performance issue.

Important

🛠️ Maintainer triage note for @AutomationDev85 · by @potiuk · 2026-07-08 15:51 UTC

Some review feedback from the maintainers is waiting on you (2 unresolved threads):

The ball is in your court — you've been assigned to this PR. Reply or push a fix in each thread, then mark them resolved. See the Pull Request quality criteria.

Automated triage — may be imperfect; a maintainer takes the next look.

@kaxil kaxil left a comment

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.

Unsure if this will make 3.3.0 cut but lgtm

@AutomationDev85

Copy link
Copy Markdown
Contributor Author

@kaxil @dstandish @seanmuth I updated the PR to align with Airflow 3.4. Do you have any hints or feedback from your side?

@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Jul 18, 2026
@vikramkoka

Copy link
Copy Markdown
Contributor

@jedcunningham do you mind taking a look at this?

@AutomationDev85
AutomationDev85 force-pushed the feature/add-index-for-trigger branch 2 times, most recently from 1f81bb8 to 006ff77 Compare August 6, 2026 08:47
@kaxil

kaxil commented Aug 7, 2026

Copy link
Copy Markdown
Member

This branch has conflicts that must be resolved

Conflicts unfortunately

@AutomationDev85
AutomationDev85 force-pushed the feature/add-index-for-trigger branch from 006ff77 to f6f74fa Compare August 10, 2026 15:36
@AutomationDev85

Copy link
Copy Markdown
Contributor Author

This branch has conflicts that must be resolved

Conflicts unfortunately

Thanks for the ping. I rebased the branch.

@kaxil
kaxil merged commit 655740b into apache:main Aug 10, 2026
77 checks passed
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
Co-authored-by: AutomationDev85 <AutomationDev85>
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
Co-authored-by: AutomationDev85 <AutomationDev85>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:db-migrations PRs with DB migration area:Triggerer kind:documentation ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants