WonYong-Jang commented on code in PR #71342:
URL: https://github.com/apache/airflow/pull/71342#discussion_r3747497152


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py:
##########
@@ -84,14 +84,12 @@
 
 
 def _get_latest_serdag(dag_id, session):
-    serdag = session.scalar(
-        select(SerializedDagModel)
-        .where(
-            SerializedDagModel.dag_id == dag_id,
-        )
-        .order_by(SerializedDagModel.id.desc())
-        .limit(1)
-    )
+    # Reuse latest_item_select_object: selecting the whole SerializedDagModel 
pulls the large
+    # data/data_compressed blob columns, and on MySQL the ORDER BY makes 
filesort load each
+    # candidate row (blob included) into the sort buffer, overflowing it with 
"Out of sort memory"
+    # for large serialized Dags.
+    # See https://github.com/apache/airflow/pull/55589

Review Comment:
   Agreed. The rationable is already documented inside 
`latest_item_select_object`, so the comment here was redundant - removed it. 
Done.



-- 
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