Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

Differance between Clustered indexes Vs Non-clustered indexes

Hi Friends,

A clustered index is a special type of index that reorders the records in the table are physically stored. In non-technical way, you are telling the database to store close values to one another on the disk. This means, a table can have only one clustered index. This has the benefit of rapid scan / retrieval of records on any operation with clustered index values.

Writing to a table with a clustered index can reduce the speed, if clustered index is other than primary key. The reason is to rearrange the records.

For e.g.
I have two tables.
1) User
2) Order



Clustered indexes

If I need to get all orders of one user, then you can create clustered index on UserID of Order table. So all records of particular records will be physically stored to each other. This will speed up when we retrieve records and increase speed.

Non-clustered indexes

A nonclustered index is a special type of index that stores the records in logical order rather than physical order. This means, a table can have many non-clustered indexes. More non-clustered indexes per table means more time it takes to write new records.

In this article Describe Difference between Clustered indexes and Non-clustered indexes.

Thank You



Leave a Reply

Your email address will not be published.