o-nikolas commented on code in PR #67217:
URL: https://github.com/apache/airflow/pull/67217#discussion_r3300234634
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -648,6 +648,7 @@ def _executable_task_instances_to_queued(self, max_tis:
int, session: Session) -
ranked_query.c.map_index_for_ordering,
)
.options(selectinload(TI.dag_model))
+ .options(selectinload(TI.dag_version))
Review Comment:
selectinload uses a single additional SELECT batched across all tis in the
result set (not n sized query), so the cost is one extra round-trip per
scheduler loop iteration rather than per ti. It's hard to make it conditional
because we're working with a bunch of tis that are mixed between versioned
bundles and not. We could do a lazy load later, but then it becomes many
requests, one for each TI lazy loaded. I think the impact here is pretty
minimal given the single extra batched select (no new joins are happening here
now)?
--
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]