title: Rails 3 - delete_all doesn't support limit scope whereas MySQL supports it
body: <p>I have a table with 9 millions of records. I was periodically syncing this data to a third party. I am keeping a column that tells if a particular row has already been synced or not. </p>
  
  <p>Now I need to delete almost <code>6 million</code> synced rows and I am not sure if running</p>
  
  <pre><code>Model.where(:sync_flag =&gt; true).delete_all
  </code></pre>
  
  <p>would be a nice idea. There are hundreds of inserts per second and I think it might result in locking the table in a way that would hurt/block the inserts ( MySQL expert needed here to correct )</p>
  
  <p>With the above prologue, I thought of using a delete with a limit clause in a loop to delete all the records until none left but with the following</p>
  
  <pre><code>Model.where(:sync_flag =&gt; true).limit(5000).delete_all
  </code></pre>
  
  <p>it raised an exception <code>delete_all doesn't support limit scope</code>. </p>
  
  <p>Is there a workaround to deal with the issue without leaving the Rails environment ?</p>