title: Why does greater-than versus equals make a difference in MySQL SELECT?
body: <p>I have a large MyISAM table. It's approaching 1 million rows. It's basically a list of items and some information about them.</p>
  
  <p>There are two indices:</p>
  
  <ul>
  <li>primary: the item ID</li>
  <li>date (date) and col (int).</li>
  </ul>
  
  <p>I run two queries:</p>
  
  <pre><code>SELECT * FROM table WHERE date = '2011-02-01' AND col &lt; 5 LIMIT 10
  
  SELECT * FROM table WHERE date &lt; '2011-02-01' AND col &lt; 5 LIMIT 10
  </code></pre>
  
  <p>The first one finishes in ~0.0005 seconds and the second in ~0.05 seconds. That is 100X difference. Is it wrong for me to expect both of these to run at roughly the same speed? I must not be understanding the indices very well. How can I speed up the second query?</p>