uranusjr commented on code in PR #30330:
URL: https://github.com/apache/airflow/pull/30330#discussion_r1153953267


##########
airflow/www/utils.py:
##########
@@ -808,6 +815,64 @@ def get_col_default(self, col_name: str) -> Any:
     filter_converter_class = AirflowFilterConverter
 
 
+class DagRunCustomSQLAInterface(CustomSQLAInterface):
+    """
+    Overwrite of custom delete and delete_all methods for speeding up
+    the DagRun deletion when DagRun has a lot of task instances.
+    The default cascade deletion was performing very slowly when task 
instances were more than 10k.
+
+    """
+
+    def delete(self, item: Model, raise_exception: bool = False) -> bool:
+        try:
+            self._delete_files(item)

Review Comment:
   I wonder if it is possible to avoid calling this non-public function. Would 
this work as expected?
   
   ```python
   def delete(self, ...):
       self.session.query(TaskInstance).where(TaskInstance.run_id == 
item.run_id).delete()
       return super().delete(...)
   ```



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