3

Will a clustered index in SQL Server 2008 R2 create an additional B-tree structure like in case of nonclustered index, where each element of the B-tree contains value and data locator?

Or SQL server just sorts all the table by the clustered index column?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    A clustered index is both a **navigation structure** (the B-Tree part), as well as the actual **data pages** at the leaf level of the navigation tree. Once you've navigated through the tree, you are **directly** at the corresponding data page and all the columns of the entry are available to oyu – marc_s May 31 '13 at 13:53

1 Answers1

2

Clustered Index by definition is the data and is stored with the index on disk in the order of the index itself. Instead of pointers to the data, the actual data is part of the index node.

http://msdn.microsoft.com/en-us/library/ms177443(v=sql.105).aspx

RBarryYoung
  • 55,398
  • 14
  • 96
  • 137
Chris H
  • 545
  • 2
  • 7
  • 3
    The on disc order is **not** necessarily the same as the index key order. e.g. if data is inserted in the middle of the index the new pages allocated could be anywhere in the file. – Martin Smith May 31 '13 at 14:06