title: DELETE using LEFT JOIN with LIMIT in MySQL
body: <p>I'm trying to delete orphan posts in my database and I have created this query:</p>
  
  <pre><code>DELETE post.*
        FROM foro_post AS post
        LEFT JOIN foro_thread AS thread USING(threadid)
        WHERE thread.threadid IS NULL
  </code></pre>
  
  <p>The problem is that I want to limit because my table has over 7,000,000 records.</p>
  
  <p>As I can't use LIMIT with the query, I tried this and actually worked, but I'm not sure if is an efficient solution or if it could be done better.</p>
  
  <pre><code>DELETE post.*
        FROM foro_post AS post
        LEFT JOIN foro_thread AS thread USING(threadid)
        WHERE thread.threadid IS NULL
        AND post.postid &lt; 500
  
        // Where &lt; 500 should be increasing as I delete records
  </code></pre>
  
  <p>How can I do this more efficiently?</p>