There are mainly two type of indexes in SQL, Clustered index and non clustered index. The differences between these two indexes is very important from SQL performance perspective.
- One table can have only one clustered index, but it can have many non-clustered index. (Approximately 250).
- A clustered index determines how data is stored physically in the table. Clustered index stores data in the cluster, related data is stored together, so that retrieval of data becomes simple.
- Clustered indexes store the data information and the data itself whereas non-clustered index stores only the information, and then it will refer you to the data stored in clustered data.
- Reading from a clustered index is much faster than reading from non-clustered index from the same table.
- Clustered index sort and store data row in the table or view based on their key value, while non-cluster has a structure separate from the data row.