airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] ubermen closed pull request #3874: [AIRFLOW-3001] Add task_instance table index 'ti_dag_date'
Date Mon, 10 Sep 2018 08:26:26 GMT
ubermen closed pull request #3874: [AIRFLOW-3001] Add task_instance table index 'ti_dag_date'

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/migrations/versions/ b/airflow/migrations/versions/
new file mode 100644
index 0000000000..2f89181bb5
--- /dev/null
+++ b/airflow/migrations/versions/
@@ -0,0 +1,42 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""add index to taskinstance
+Revision ID: 82c452539eeb
+Revises: 9635ae0956e7
+Create Date: 2018-09-10 17:04:32.058103
+# revision identifiers, used by Alembic.
+revision = '82c452539eeb'
+down_revision = '9635ae0956e7'
+branch_labels = None
+depends_on = None
+from alembic import op
+import sqlalchemy as sa
+def upgrade():
+    op.create_index('ti_dag_date', 'task_instance', ['dag_id', 'execution_date'], unique=False)
+def downgrade():
+    op.drop_index('ti_dag_date', table_name='task_instance')
diff --git a/airflow/ b/airflow/
index 2096785b41..c41f2a9dbe 100755
--- a/airflow/
+++ b/airflow/
@@ -880,6 +880,7 @@ class TaskInstance(Base, LoggingMixin):
     __table_args__ = (
         Index('ti_dag_state', dag_id, state),
+        Index('ti_dag_date', dag_id, execution_date),
         Index('ti_state', state),
         Index('ti_state_lkp', dag_id, task_id, execution_date, state),
         Index('ti_pool', pool, state, priority_weight),


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message