ColtenOuO opened a new pull request, #71915: URL: https://github.com/apache/airflow/pull/71915
### Summary `get_data_dependencies()` (the Assets dependency-graph API) resolved each producing/consuming task's inlet/outlet asset references with one DB query per task, inside a BFS loop. An asset shared by many Dags/tasks — common in multi-team deployments — turned opening its graph into hundreds of sequential round trips in a single request. ### Change - The same file already batches Dag entry-point resolution the same way (`_get_dag_entry_points`); this extends that pattern to the two remaining per-task query sites. - Task keys needing an inlet or outlet lookup are now collected across the whole BFS round and resolved with one `tuple_(dag_id, task_id).in_(...)` query each, instead of one query per task. ### Round-trip reduction Measured with the new regression test (3 Dags each with one task producing the same asset, in a single BFS round): total DB queries per request dropped from **11 to 9 — 2 fewer round trips** (3 individual inlet queries collapsed into 1 batched query). This scales with the number of tasks touched per round: for N tasks needing an inlet lookup, it goes from N round trips to 1; same for M tasks needing an outlet lookup. For an asset shared by hundreds of tasks, this is a reduction from hundreds of round trips down to at most 2 per BFS round (one inlet batch, one outlet batch). --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Sonnet 5) -- 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]
