The DELETE statement uses a WHERE ... IN clause that is very slow for large datasets in the IN clause. This can potentially be improved with a temporary table with an index.
DELETE
WHERE ... IN
IN
\rfc @shinde @tara @laurens