What is SQL Clustered and Non-Clustered key?
Ask by ICSM Computer
Updated 22 Mar 2026
In SQL Server, Clustered and Non-Clustered keys are related to indexes. Indexes are used to improve query performance and speed up data searching in tables.
These are used in Microsoft SQL Server and managed using SQL Server Management Studio.
1. What is Clustered Key (Clustered Index)?
A Clustered Index defines the physical order of data in the table.
This means:
Example
Here, Primary Key creates Clustered Index by default.
Data will be stored like:
Sorted by Id.
Key Points
2. What is Non-Clustered Key (Non-Clustered Index)?
Think like:
Table data stays same, index stores pointers.
Example
Key Points
3. Difference Between Clustered and Non-Clustered
4. Real Example
Table: Employees
Clustered on Id
Stored as:
Non-Clustered on Name
Index:
5. When to Use Clustered Index
Use when:
Example:
6. When to Use Non-Clustered Index
Use when:
Example:
7. Clustered vs Heap
8. Conclusion
Both are important for performance tuning in SQL.