May 2019
Intermediate to advanced
484 pages
11h 23m
English
As we discussed in the previous chapter, if a table does not have a clustered index, it is stored as a heap. While heap data structures allow for fast inserts, they are generally less efficient for data access, so it is recommended that most tables in a SQL Server database have a clustered index.
The clustered index defines the structure of the table itself. Once we create a clustered index, the data rows are stored in the index itself, ordered by the index keys. For this reason, there can be only one clustered index on a table. When choosing which column or columns should be used for the clustered index key, consider the following guidelines:
Read now
Unlock full access