title: Will indexes get used if you query a subset of the columns of the index?
body: <p>So consider I have the following table:</p>
  
  <p>table:</p>
  
  <ul>
  <li>id (Int, Primary Key)</li>
  <li>c1</li>
  <li>c2</li>
  <li>c3</li>
  <li>c4</li>
  <li>c5</li>
  </ul>
  
  <p>Assume I use queries that differ at runtime (a website for example where checkboxes denote whether or not to search on a specific field), some possible instances:</p>
  
  <p>(Using some <code>x, y, z</code> for the values)</p>
  
  <ul>
  <li><code>SELECT * FROM table WHERE c1 = 1 AND c2 = 2</code></li>
  <li><code>SELECT * FROM table WHERE c1 = 1 AND c2 = 2 AND c3 = x AND c4 = y</code></li>
  <li><code>SELECT * FROM table WHERE c1 = 2 AND c2 = 3</code></li>
  <li><code>SELECT * FROM table WHERE c1 = 2 AND c2 = 3 AND c5 = z</code></li>
  </ul>
  
  <p>The questions:</p>
  
  <ol>
  <li>What is the effect of an index on <code>(c1, c2, c3, c4, c5)</code>? How will it be used in the several queries?</li>
  <li>What would the best indexes be to create on this table?</li>
  </ol>