Skip to content

Conversation

@hussein-awala
Copy link
Member

This PR improves the performance of clean_unsed triggers method by executing the cleanup for Postgres and SQLite in a single query, which could reduce the latency and memory usage.

For MySQL, it doesn't support DELETE with JOIN, so we need to keep the current behavior:

[SQL: DELETE FROM `trigger` WHERE `trigger`.id IN (SELECT `trigger`.id 
FROM `trigger` LEFT OUTER JOIN task_instance ON `trigger`.id = task_instance.trigger_id GROUP BY `trigger`.id 
HAVING count(task_instance.trigger_id) = %s)]
[parameters: (0,)]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

@hussein-awala hussein-awala added the type:improvement Changelog: Improvements label Apr 1, 2024
@hussein-awala hussein-awala added this to the Airflow 2.9.0 milestone Apr 1, 2024
@hussein-awala hussein-awala requested a review from dstandish as a code owner April 1, 2024 23:38
@eladkal eladkal merged commit 12d38e1 into apache:main Apr 2, 2024
ephraimbuddy pushed a commit that referenced this pull request Apr 2, 2024
ephraimbuddy pushed a commit that referenced this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Triggerer type:improvement Changelog: Improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants