Structure of a Multi-column index in SQL server

Viewed 888
2 Answers

The index key values are sorted first by the first key column, then by the second key column, and then yt's exactly the same, except with additional columns on the non-leaf nodes. So if the first key column is a number, and the second the name of an animal, the non-leaf pages might have ranges like:

                                     (1,'cat')-(1000,'horse')
                                              ^
                  (1,'cat')-(500,'snake')               (500,'tiger')-(1000,'horse') 
                           ^                                         ^
(1,'cat')-(250,'elephant')   (250,'fox')-(500,'snake')          . . .
Related