Skip to content

Commit

Permalink
Remove stale comment about TI index (#39470)
Browse files Browse the repository at this point in the history
The index this comment is talking about was removed in #30762.
  • Loading branch information
jedcunningham committed May 7, 2024
1 parent a65a837 commit 0c159bf
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions airflow/models/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1387,14 +1387,6 @@ class TaskInstance(Base, LoggingMixin):
Index("ti_dag_run", dag_id, run_id),
Index("ti_state", state),
Index("ti_state_lkp", dag_id, task_id, run_id, state),
# The below index has been added to improve performance on postgres setups with tens of millions of
# taskinstance rows. Aim is to improve the below query (it can be used to find the last successful
# execution date of a task instance):
# SELECT start_date FROM task_instance WHERE dag_id = 'xx' AND task_id = 'yy' AND state = 'success'
# ORDER BY start_date DESC NULLS LAST LIMIT 1;
# Existing "ti_state_lkp" is not enough for such query when this table has millions of rows, since
# rows have to be fetched in order to retrieve the start_date column. With this index, INDEX ONLY SCAN
# is performed and that query runs within milliseconds.
Index("ti_pool", pool, state, priority_weight),
Index("ti_job_id", job_id),
Index("ti_trigger_id", trigger_id),
Expand Down

0 comments on commit 0c159bf

Please sign in to comment.