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


##########
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:
   It's a protected method, and it's okay to call it in the inherited classes. 
The main idea of this method is that it should delete all instances in one 
transaction and roll back if something is wrong.



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