This mysql query is running for around 10 hours and has not finished. Something is horribly wrong.
Two tables (text and spam) are here. Spam stores the ids of spam e
Your choice of where id in (select ...) will always perform poorly.
where id in (select ...)
Instead, use a normal join which will be very efficient:
DELETE `text` FROM spam join `text` on `text`.old_id = spam.textid;
Notice selection from spam first, then joining to text, which will give the best performance.