title: How SQL Server indexing works
body: <p>SQL Server uses binary tree with intermediate and leaf node for search but how it will do this. Ex. If a table employee has two fields </p>
  
  <pre><code>Id bigint 
  Name varchar(50) 
  </code></pre>
  
  <p>with values such as</p>
  
  <pre><code>Id                  Name
  1                   Ashish
  2                   Amit 
  3                   Bhavin
  4                   Dinesh 
  </code></pre>
  
  <p>If we have created composite non-clustered index on both of this columns with name as first and Id after this than how it work. Whether intermediate nodes contain 1) A-F 2)G-M ... or something else. Also once name is searched in binary then after this tree has id has intermediate node.</p>
  
  <p>In short how does SQL server search in this type of conditions?</p>