From the course: Developing Microsoft SQL Server 2016 Databases

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Clustered indexes

Clustered indexes

- [Instructor] The primary index for a table is called the clustered index. When a clustered index is applied to a data table the rows in the table get sorted and stored based off of the clustered indexes key value. A clustered index is what converts a heap into an orderly arrangement that allows record seeking rather than just full table scans. In essence, clustered indexes not only define the sorting order for a table, they are the table. This is why there can only be a single clustered index per table, as there's only one way that the table will naturally be stored on disk. When a clustered index is applied to a heap, the records are sorted according to their indexing column or columns, and records are divided up into pages on disk. This makes getting to a specific record easy when searching by the key value, in this case an incrementing identity integer. Once SQL Server arrives at the appropriate leaf, all of the…

Contents