title: MySQL indices and order
body: <p>This is a question that I've had forever.</p>
  
  <p>As far as I know the order of indices matter. So an index like <code>[first_name, last_name]</code> is not the same as <code>[last_name, first_name]</code>, right?</p>
  
  <p>If I only define the first index, does it mean that it will only used for </p>
  
  <pre><code>SELECT * FROM table WHERE first_name="john" AND  last_name="doe"; 
  </code></pre>
  
  <p>and not for </p>
  
  <pre><code>SELECT * FROM table WHERE  last_name="doe" AND first_name="john";
  </code></pre>
  
  <p>Since I am using a ORM, I have no idea in which order these columns are going to be called. Does that mean that I have to add indices on all permutations? That is doable if I have a 2 column index, but what happens if my index is on 3 or 4 columns? </p>