what is the difference between a CLUSTERED INDEX and a NON CLUSTERED INDEX?

  • A CLUSTERED INDEX sorts the column into order and maintains the index.
  • These are similar to a DICTIONARY where the values point to actual data.
  • By default, a CLUSTERED INDEX is created for a PRIMARY KEY column.
  • A table can contain only a single CLUSTERED INDEX.
  • A NON-CLUSTERED INDEX is created on non-key columns in the table
  • NON-CLUSTERED INDEXES don't require any sorting to store data.
  • The indexes are maintained in the form of a TREE with leaves pointing to actual data rows.
  • NON-CLUSTERED INDEXES take more space to maintain.
  • A table can contain more than one NON-CLUSTERED INDEXES
  • A CLUSTERED INDEX sorts the column into order and maintains the index.
  • These are similar to a DICTIONARY where the values point to actual data.
  • By default, a CLUSTERED INDEX is created for a PRIMARY KEY column.
  • A table can contain only a single CLUSTERED INDEX.
  • A NON-CLUSTERED INDEX is created on non-key columns in the table
  • NON-CLUSTERED INDEXES don’t require any sorting to store data.
  • The indexes are maintained in the form of a TREE with leaves pointing to actual data rows.
  • NON-CLUSTERED INDEXES take more space to maintain.
  • A table can contain more than one NON-CLUSTERED INDEXES
Sriram Mannava
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply

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