8.2
Clustered vs. Non-clustered Indexes
Clustered vs. Non-clustered Indexes
- Clustered index: The values in the column indexed are physically stored in alphabetical or numeric order.
- You can only have one clustered index per table.
- If you assign a primary key, the system automatically creates a clustered index on that column.
- If no primary key is defined on a table, the first column that has an index defined for it becomes the clustered index.
- Non-clustered index: Column values are not in alphabetical or numeric order
- You can add as many non-clustered indexes to a table as you want.
- You should only create additional non-clustered indexes on a table if you need to search or perform a join on that column. When you create a foreign key column, a non-clustered index is automatically created for that column.
End-of-Chapter Survey
: How would you rate the overall quality of this chapter?- Very Low Quality
- Low Quality
- Moderate Quality
- High Quality
- Very High Quality