title: MySQL query timing out: (70100): Query execution was interrupted
body: <p>I want to execute a MySQL query in order to delete all <code>Wp_posts</code> table rows which <code>post_parent</code> is a <code>Wp_posts</code> row with <code>post_type</code> set to product;</p>
  
  <p>So I do</p>
  
  <pre><code>INSERT INTO temp (SELECT DISTINCT id FROM wp_posts WHERE post_type = "product")
  </code></pre>
  
  <p>(Inserts 4k rows)</p>
  
  <pre><code>DELETE FROM wp_posts WHERE post_parent IN (SELECT tid FROM temp)
  </code></pre>
  
  <p>..</p>
  
  <p>After around 100 seconds, it returns</p>
  
  <blockquote>
    <p>ERROR 1317 (70100): Query execution was interrupted</p>
  </blockquote>
  
  <p>What could be making this query so bloody slow?</p>