title: Limit on inner select does not seem to be applied by SQLite
body: <p>The following SQLite query is fast (with sqlite 3.7.5):</p>
  
  <pre><code>sqlite&gt; select distinct DOB from (select * from MyTable limit 3) limit 20;
  1958-11-05
  1959-01-01
  1963-06-07
  </code></pre>
  
  <p>while the following one is slow (<code>limit 20</code> was removed):</p>
  
  <pre><code>sqlite&gt; select distinct DOB from (select * from MyTable limit 3);
  1933-01-03
  1934-12-24
  1935-01-07
  </code></pre>
  
  <p>I find this surprising, because I expect the inner <code>limit</code> to quickly extract only 3 rows, so that the external <code>limit 20</code> really does not matter; however, the timings of both queries are quite different.  Why is the first query much faster?</p>