title: what does a B-tree index on more than 1 column look like?
body: <p>So I was reading up on indexes and their implementation, and I stumbled upon this website that has a brief explanation of b-tree indexes:</p>
  
  <p><a href="http://20bits.com/articles/interview-questions-database-indexes/" rel="noreferrer">http://20bits.com/articles/interview-questions-database-indexes/</a></p>
  
  <p>The b-tree index makes perfect sense for indexes that are only on a single column, but let's say I create an index with multiple columns, how then does the b-tree work?  What is the value of each node in the b-tree?  </p>
  
  <p>For example, if I have this table:</p>
  
  <pre><code>table customer:
  id    number
  name   varchar
  phone_number   varchar
  city   varchar
  </code></pre>
  
  <p>and I create an index on: (id, name, city) </p>
  
  <p>and then run the following query:</p>
  
  <pre><code>SELECT id, name 
    FROM customer
   WHERE city = 'My City';
  </code></pre>
  
  <p>how does this query utilize the multiple column index, or does it not utilize it unless the index is created as (city, id, name) or (city, name, id) instead?</p>