kaxil commented on a change in pull request #8227: URL: https://github.com/apache/airflow/pull/8227#discussion_r431140537
########## File path: airflow/models/dagrun.py ########## @@ -54,25 +54,27 @@ class DagRun(Base, LoggingMixin): _state = Column('state', String(50), default=State.RUNNING) run_id = Column(String(ID_LEN)) external_trigger = Column(Boolean, default=True) + run_type = Column(String(50), nullable=True) conf = Column(PickleType) dag = None __table_args__ = ( - Index('dag_id_state', dag_id, _state), + Index('dag_id_state_type', dag_id, _state, run_type), Review comment: ```suggestion Index('dag_id_state', dag_id, _state), Index('dag_run_type', run_type), ``` OR ``` Index('dag_id_state', dag_id, _state), Index('dag_id_run_type', dag_id, run_type), ``` Maybe 2 indexes as most of the times we are filtering based on DagRunType and DagId WDYT? @turbaszek @ashb @mik-laj ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org