07-31-2023, 09:47 AM
Clustered Index
---------------
- Only one clustered index can be there in a table
- Sort the records and store them physically according to the order
- Data retrieval is faster than non-clustered indexes
- Do not need extra space to store logical structure
## Non Clustered Index ##
- There can be any number of non-clustered indexes in a table
- Do not affect the physical order. Create a logical order for data rows and use pointers to physical data files
- Data insertion/update is faster than clustered index
- Use extra space to store logical structure
----------
Apart from these differences you have to know that when table is non-clustered (when the table doesn't have a clustered index) data files are unordered and it uses Heap data structure as the data structure.
---------------
- Only one clustered index can be there in a table
- Sort the records and store them physically according to the order
- Data retrieval is faster than non-clustered indexes
- Do not need extra space to store logical structure
## Non Clustered Index ##
- There can be any number of non-clustered indexes in a table
- Do not affect the physical order. Create a logical order for data rows and use pointers to physical data files
- Data insertion/update is faster than clustered index
- Use extra space to store logical structure
----------
Apart from these differences you have to know that when table is non-clustered (when the table doesn't have a clustered index) data files are unordered and it uses Heap data structure as the data structure.