anusha975 commented on issue #61894:
URL: https://github.com/apache/airflow/issues/61894#issuecomment-3901254994

   Thanks for raising this issue.
   
   I reviewed the query and it appears that the existence check on 
task_instance.dag_version_id may cause a full table scan in large environments 
where the column is not indexed.
   
   Since dag_id is available in the calling context, adding it to the filter 
condition (and potentially introducing a composite index on (dag_id, 
dag_version_id)) could significantly improve performance.
   
   I’d be happy to work on a PR for this improvement if maintainers agree with 
this direction.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to