Páginas

jueves, 2 de enero de 2014

SQL Server - What is a Clustered Index?


A clustered index sorts and stores the data rows of the table in order based on the clustered index key. The clustered index key is implemented as a B-tree. Each page in a B-tree is called index node. The top of node of the B-tree is called the root node.

The bottom level of the nodes is called the leaf level. Any index level between the root node and the leaf nodes are collectively known as intermediate nodes.  Each page in the intermediate or bottom levels has a pointer to the preceding and subsequent pages, forming a doubly linked list. This structure provides a highly efficient mechanism to speed the process of locating data.

In a clustered index, the root and intermediary nodes contain index pages holding index rows. Each index rows contains a key value and a pointer to either an intermediate level page in the B-tree or a data row in the leaf level of the index. The pages in each level of the index are linked in a doubly linked list

Because a clustered index determines the order in which table rows are actually stored, each table can have only one clustered index- the table’s rows cannot stored in more than order.

What is a Clustered Index

No hay comentarios:

Publicar un comentario