2
Reply

.NET and SQL Server Interview Question - What are difference between Cluster index and Non-Cluster index?

Shivprasad Koirala

Shivprasad Koirala

13 years ago
4.3k
0
Reply

    When we create primary key in table clustered Index automatically create. A table has only one clustered Index. More than one Non Clustered Index.

    Pramod Verma
    9 years ago
    0


    Answer:

    Both of these indexes uses "B-tree" structure but in Cluster index the "Leaf Node" actually points the physical data, but in Non-Cluster index it point’s to the "Row ID" and then the "Row ID" points to the "Leaf Node" of Cluster Index.
    Below is the diagram of Cluster and Non-Clustered index.
     


     

    Cluster Index Non-Cluster Index
    A table can have only one Cluster Index as it point to the physical data. A table can have more than one Non-Cluster Index as it only points to the pointer of Cluster Index.
    Physical data is stored as per Cluster Index. There is no relation of physical data.
    The leaf node of Cluster Index consist of data pages. The leaf node of Non-Clusted Index contain Index row.

     

    Regards,

    Please click here to see more .NET and SQL Server interview questions

    Shivprasad Koirala
    13 years ago
    0