MySQL query timing out: (70100): Query execution was interrupted

后端 未结 2 1468
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 01:37

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

2条回答
  •  情话喂你
    2021-01-19 01:59

    Some versions of MySQL implement in with a subquery in a very inefficient manner. Change it to a correlated exists clause:

    DELETE FROM wp_posts
        WHERE exists (SELECT 1 FROM temp where temp.tid = wp_posts.post_parent)
    

提交回复
热议问题