title: Using IN clause vs. multiple SELECTs
body: <p>I was wondering which of these would be faster (performance-wise) to query (on MySQL 5.x CentOS 5.x if this matters):</p>
  
  <pre><code>SELECT * FROM table_name WHERE id=1;
  SELECT * FROM table_name WHERE id=2;
  .
  .
  .
  SELECT * FROM table_name WHERE id=50;
  </code></pre>
  
  <p>or...</p>
  
  <pre><code>SELECT * FROM table_name WHERE id IN (1,2,...,50);
  </code></pre>
  
  <p>I have around 50 <code>id</code>s to query for. I know usually DB connections are expensive, but I've seen the <code>IN</code> clause isn't so fast either [sometimes].</p>