vchiapaikeo commented on issue #38776: URL: https://github.com/apache/airflow/issues/38776#issuecomment-2074765971
Hey @pankajkoti ! Yes, that would be wonderful! The only thing I can think of from looking at the queries and the explain plan is something around the dag table - since there already is an index on dag_run and the state col. Based on those explain plans, perhaps something on the dag table around dag_id, is_subdag, and is_active? I see two existing indices on dag right now: ```sql CREATE INDEX idx_root_dag_id ON dag (root_dag_id ASC); CREATE INDEX idx_next_dagrun_create_after ON dag (next_dagrun_create_after ASC); ``` The other thing I was thinking about (but have just been very slow to implement and try) is a ThreadPool for some of the queries in the /home route. The slow queries are [here](https://github.com/apache/airflow/blob/main/airflow/www/templates/airflow/dags.html#L148-L157) and are retrieved from [this call](https://github.com/apache/airflow/blob/main/airflow/www/views.py#L739). These get loaded serially here --> https://github.com/apache/airflow/blob/main/airflow/www/views.py#L858-L859 My thought is that [these queries](https://github.com/apache/airflow/blob/main/airflow/www/views.py#L847-L859) plus [this one](https://github.com/apache/airflow/blob/main/airflow/www/views.py#L915-L921) can all get submitted to a threadpool for execution so that they run concurrently. Wanted to get the teams' thoughts on that and if you think it would work. The implementation shouldn't be too bad. -- 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. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org