title: MySQL - how to refresh table after a large number of deletes
body: <p>I just ran a simple delete query in the form:</p>
  
  <pre><code>DELETE*FROM [db.table] WHERE id &lt; [value];
  </code></pre>
  
  <p>This deleted about 80 million rows from the database (I had archived the data and no longer needed it).  This system constantly has data coming in at a rate of about 20 inserts per second and now there are a couple thousand entries in the database again.</p>
  
  <p>If I run a query (limited to 1000 rows) that sorts descending, like this:</p>
  
  <pre><code>SELECT*FROM [db.table] ORDER BY id DESC;
  </code></pre>
  
  <p>I immediately get the results back, however if I sort ascending, like this:</p>
  
  <pre><code>SELECT*FROM [db.table] ORDER BY id ASC;
  </code></pre>
  
  <p>the query will timeout after 10 minutes.  It seems to me (and this is just a guess) that the query is going through all of the ids for my recently deleted rows and never gets to the newest data. Is that possible?</p>
  
  <p>How do I get 'sort ASC' query to work?  Do I need to do some sort of refresh? Thanks</p>