title: big delete query giving timeout
body: <p>I have a delete query like this </p>
  
  <pre><code>DELETE c1
  FROM tablename c1, tablename c2 
  WHERE c1.rewardID &gt; c2.rewardID AND 
        c1.transactionDate = c2.transactionDate AND 
        c1.orderID = c2.orderID 
  </code></pre>
  
  <p>This is giving me timeout error both from php and phpmyadmin as there is a number of rows needs to be deleted. How can  I execute it without timeout error ?</p>
  
  <p>The issue is it is showing Lost connection to MySQL server during query when I print mysql_error() </p>
  
  <p>can anyone give a select version of this query so that I can iterate it through php and delete</p>
  
  <p>Explain details :</p>
  
  <pre><code>id  select_type     table   type    possible_keys   key     key_len     ref     rows    Extra   
  1   SIMPLE  c1  ALL     PRIMARY,rewardID    NULL    NULL    NULL    92966   
  1   SIMPLE  c2  ALL     PRIMARY,rewardID    NULL    NULL    NULL    92966   Using where; Using join buffer
  </code></pre>