Non-Clustered Index : If the order of values in index and order of values in the table are not same then it is called non clustered index.
Clustered Index: If the order of records in the table and order of the records in the index is same then it is called clustered index.
Non-Clustered Index : Non clustered index will be created automatically one you create unique key on a column.
Clustered Index : Clustered index will be automatically once you create a primary key.
We can have only one clustered index for a table.
we can create up to 249 non clustered indexes on a table.
Non-Clustered Index : The logical order of the index does not match the physical stored order of rows on disk.
Clustered Index : The logical order of the index matches the physical stored order of rows on disk.
Clustered Index is faster than non-clustered index.
Because the leaf level of a clustered index is the actual
data and the data is resorted in case of clustered index.
In case of non-clustered index the leaf level is actually a
pointer to the data in rows. The data is stored in one
place, the index in another, with pointers to the storage
location of the data. The items in the index are stored in
the order of the index key values, but the information in
the table is stored in a different order.
No comments:
Post a Comment