title: How to optimize repeat MySQL sorted selects
body: <p>Suppose that I have a large db with columns a, b, and c.  Suppose that I then wish to select the xth through (x+100)th rows according to some ordering on multiple columns.  I can accomplish this using the  <code>ORDER BY</code> and <code>LIMIT</code> constructs:</p>
  
  <pre><code>SELECT * FROM table_name ORDER BY b ASC, c DESC, a DESC LIMIT x, 100
  </code></pre>
  
  <p>What if I then wish to conduct many similar queries using the same order (ascending on b, descending on c, then descending on a) but with different range limits?  Intuitively, the costly sorting operation shouldn't need to be repeated for each such query.</p>
  
  <p>I've looking into optimizing <code>ORDER BY</code> operations using indices (<a href="http://dev.mysql.com/doc/refman/5.6/en/order-by-optimization.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.6/en/order-by-optimization.html</a>), but unfortunately it does not seem possible to create indicies that include mixed ascending and descending orders.</p>
  
  <p>Is there a good approach to optimizing this?  It seems like a reasonably common use case.</p>