Skip to content

Commit 13907b7

Browse files
jedcunninghamsunank200
authored andcommitted
[v3-0-test] Faster note on grid endpoint (#51247)
For the specific scenario I'm testing, this reduces the response time from ~9s to ~7s. (cherry picked from commit 95bea5e) Co-authored-by: Jed Cunningham <[email protected]> Co-authored-by: Ankit Chaurasia <[email protected]>
1 parent a7c5605 commit 13907b7

File tree

1 file changed

+2
-2
lines changed
  • airflow-core/src/airflow/api_fastapi/core_api/routes/ui

1 file changed

+2
-2
lines changed

airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import structlog
2525
from fastapi import Depends, HTTPException, status
2626
from sqlalchemy import select
27-
from sqlalchemy.orm import joinedload
27+
from sqlalchemy.orm import joinedload, selectinload
2828

2929
from airflow import DAG
3030
from airflow.api_fastapi.auth.managers.models.resource_details import DagAccessEntity
@@ -133,7 +133,7 @@ def grid_data(
133133
# Retrieve, sort and encode the Task Instances
134134
tis_of_dag_runs, _ = paginated_select(
135135
statement=select(TaskInstance)
136-
.join(TaskInstance.task_instance_note, isouter=True)
136+
.options(selectinload(TaskInstance.task_instance_note))
137137
.where(TaskInstance.dag_id == dag.dag_id)
138138
.where(TaskInstance.run_id.in_([dag_run.run_id for dag_run in dag_runs])),
139139
filters=[],

0 commit comments

Comments
 (0)