tirkarthi commented on code in PR #22934:
URL: https://github.com/apache/airflow/pull/22934#discussion_r849197018


##########
airflow/models/taskfail.py:
##########
@@ -37,6 +39,9 @@ class TaskFail(Base):
     end_date = Column(UtcDateTime)
     duration = Column(Integer)
 
+    task_instance = relationship("TaskInstance", lazy='joined', innerjoin=True)

Review Comment:
   yes, select is the default. I am confused how join will help in avoiding N+1 
since each attribute access inside for loop will trigger a query and if there 
are 10 objects it will trigger 10 select queries to task_instance table for 
execution_date. Can you please add the query/code?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to