469,342 Members | 5,615 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,342 developers. It's quick & easy.

What is the difference between Cluster and Non-Cluster Index?

What is the difference between Cluster and Non-Cluster Index?
Jun 3 '19 #1
3 2702
Both Clustered Index and Nonclustered Indexes have same physical structure and stored as a B-Tree structure. But Single table have single clustered index but more than non clustered index. When you create primary key it will create clustered index by default but you can override this behaviour and if you create unique key it will create non clustered index.
Jun 3 '19 #2
Rabbit
12,516 Expert Mod 8TB
That's not quite correct.

A clustered index physically changes the order that the rows are stored on the disk. That is, the order of the rows in the clustered index matches the order of the rows stored on the disk.

A non-clustered index will just have pointers to the rows and so the order of the non-clustered index won't match the order of the rows stored on the disk.
Jun 3 '19 #3
AjayGohil
84 64KB
Hi,

Following are difference between Clustered and Nonclustered Index:
  • A Clustered Index physically sort all rows while Nonclustered Index doesn't.
  • In SQL, one table can only have one Clustered Index but there is no such restriction on NonClustered Index.
  • In many relational databases, Clustered Index is automatically created on the primary key column.
  • Clustered Index can improve the performance of data retrieval while non-clustered index should be created on columns which are used in the join, where, and order by clause.
Feb 26 '20 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by diadia | last post: by
1 post views Thread by Rada Chirkova | last post: by
15 posts views Thread by rAinDeEr | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.