What is the difference between clustered and non clustered index in SQL? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

What is the difference between clustered and non clustered index in SQL?

10th Nov 2016, 6:19 PM
Jaydeep Khatri
Jaydeep Khatri - avatar
2 Answers
+ 3
With a clustered index the physical (on disk) order and the logical order of the data in a table are the same. Every time you edit/change order of the rows they are rearranged on disk. With unclustered index the data refers to another table that contains pointers to the physical data written on the disk. It's slower to read, 'cause it has to find the pointer first and then the data.
12th Nov 2016, 12:48 PM
Gleb Golov
Gleb Golov - avatar
+ 3
#Gleb described the speed advantage of clustered index. The advantage of non-clustered index is that you can have many of them, whereas there can be only one clustered.
5th Dec 2016, 9:21 AM
Igor B
Igor B - avatar