I want to execute a MySQL query in order to delete all Wp_posts table rows which post_parent is a Wp_posts row with post_type
Wp_posts
post_parent
post_type
Some versions of MySQL implement in with a subquery in a very inefficient manner. Change it to a correlated exists clause:
in
exists
DELETE FROM wp_posts WHERE exists (SELECT 1 FROM temp where temp.tid = wp_posts.post_parent)