title: Does the order of fields in a WHERE clause affect performance in MySQL?
body: <p>I have two indexed fields in a table - <code>type</code> and <code>userid</code> (individual indexes, not a composite). </p>
  
  <p><code>type</code>s field values are very limited (let's say it is only 0 or 1), so 50% of table records have the same <code>type</code>. <code>userid</code> values, on the other hand, come from a much larger set, so the amount of records with the same <code>userid</code> is small.</p>
  
  <p>Will any of these queries run faster than the other:</p>
  
  <pre><code>select * from table where type=1 and userid=5
  select * from table where userid=5 and type=1
  </code></pre>
  
  <p>Also if both fields were not indexed, would it change the behavior?</p>