I need a short explaining of clustered index.
- What is a clustered index?
- What are best practices for using the clustered index?
In simple terms...
A telephone directory: the data is the index/the index is the data. To look you up, I'd start with Rezaei, Amir for example. No external lookup is needed.
In database terms:
The table data and clustered index are one and the same (in SQL Server, also InnoDB, Oracle IOT)
Best practice is narrow, numeric, strictly increasing (think IDENTITY or Autonumber column). Data types like GUIDs are not a good idea
Links to read (to avoid bloating this answer)
Edit, to fully explain my best practice suggestions, follow the link in Eric Humphrey's comment: Queen of Indexing: Kimberly Tripp
|show 5 more comments|
Its an index on the data itself such that the records are physically sorted by the field you have the clustered index on. This is why you can have only one Clustered Index per table.
Non Clustered Index is not as fast for look ups but you can have many of these types of indexes on a table.