title: Why does doctrine use WHERE IN instead of LIMIT?
body: <p>Why does doctrine (1.2) use <code>WHERE IN</code> instead of <code>LIMIT</code>?</p>
  
  <p>This code:</p>
  
  <pre><code>Doctrine_Query::create()
     -&gt;from('Table t')
     -&gt;limit(10)
     -&gt;getSqlQuery();
  </code></pre>
  
  <p>Returns something like this:</p>
  
  <pre><code>SELECT t.id_table AS t__id_table FROM table AS t WHERE t__id_table IN (1,2,3,4,10,12,18,20,21,25);
  </code></pre>
  
  <p>Instead of this:</p>
  
  <pre><code>SELECT t.id_table AS t__id_table FROM table AS t LIMIT 10;
  </code></pre>
  
  <p>This behaivor is same for any <code>LIMIT</code> value. This generates a very long queries for high <code>LIMIT</code> values.</p>
  
  <p>Bonus question: How does Doctrine know, what ids to use? (By sending another query to DB??)</p>