title: MySQL: delete query taking too long
body: <p>I am trying to delete records from table with duplicate column values but it's taking forever. Basically it gets stuck and no response for hours. I have a significantly large table with over 1.3M records. Is the query inefficient? any wat to optimize it? </p>
  
  <pre><code>delete n1 from ids n1, ids n2 where n1.id &gt; n2.id and n1.user_id = n2.user_id
  </code></pre>
  
  <p>Database is remote, and am using putty to run queries.</p>