What is the difference between a clustered and a non-clustered index in SQL?

  • A clustered index allows duplicates, while a non-clustered index enforces unique values.
  • A clustered index determines the physical order of data rows in a table, while a non-clustered index does not affect the physical order.
  • A clustered index is used for text-based columns, and a non-clustered index is used for numeric columns.
  • A non-clustered index is faster for read operations, while a clustered index is faster for write operations.
A clustered index in SQL determines the physical order of data rows in a table, affecting the way data is stored on disk. In contrast, a non-clustered index does not impact the physical order of data. Understanding these differences is crucial for optimizing query performance.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *