Sunday, February 23, 2014

One Clustered Index

The clustered has two main properties:



  1. The table data is part of the index (in the leaf level)

  2. It is used by all other indexes to access data that is not part of the (nonclustered) index


The first point is just a description of an index that covers all columns of the table. If you don't have any column with a very large possible size (such as text, varchar(max), etc.) then a nonclustered index can also cover all columns. From that point of view, the clustered index is just one covering index.


The second point has to do with the index implementation. Without a clustered index, any index will point to the data page that stores the data for the index key. With a clustered index, any other index will point to the clustered index key, which in turn, includes the data at the leaf level.


This second point is a fixed mechanism.




Gert-Jan


No comments:

Post a Comment