title: Mysql: multiple column indexes, does the order of the multiple column index matter?
body: <p>I'm trying to understand multiple-column indexes.</p>
  
  <p>The question is:
  <strong>Does the order of the multiple column index matter?</strong></p>
  
  <p>I have a table with columns A, B, C and D.</p>
  
  <p>I execute a query:</p>
  
  <pre><code>SELECT A FROM table WHERE D='2' AND B='1' AND C='0' ;
  </code></pre>
  
  <p>Is there a difference in speed if I create only one multiple column index:</p>
  
  <ul>
  <li>B, C, D </li>
  <li>D, B, C </li>
  </ul>
  
  <p>Or doesn't the order of the multiple column index matter?</p>
  
  <p>Extra question:</p>
  
  <p><strong>If I execute the following query, does it still benefit from the multiple column index?</strong></p>
  
  <pre><code>SELECT A, B FROM tablename WHERE D='2' AND C='0';
  </code></pre>
  
  <p>Why (not)?</p>