• Adam Thurgar

Clustered index column in non-clustered indexes


Whilst recently reviewing performance issues on a large legal system, I noticed that every non-clustered index, explicitly included the column/s of the clustered index. This is unnecessary as SQL Server adds the columns of the clustered index into the non-clustered index and effectively 'hides' these columns. Therefore you don't need to include them in the definition. There is no real penalty for having these duplicates - although any updates to the clustered index columns would occur twice and the size of the non-clustered index is larger. Any index reorganisation or statistic updates may also take fractionally longer.


Recent Posts

See All