Clustered Indexing

2020-08-02 10:55发布

问题:

Does Clustered index needs one extra table to sort/keep the rows data? When it does the sorting , on each Insert or delete statement or when ? How clustered index store data and how it is different from Non-clustered one.

回答1:

  • The data is the clustered index
  • Index sort is on creation/rebuild only
  • Inserts may create page splits and pointers
  • Deletes leave gaps
  • Gaps are removed by index rebuild
  • Clustered = data sorted as per definition
  • Non-clustered = points to clustered index and has it's own sort

Starter article on Simple-Talk

A more in depth article on Simple-Talk

Edit: Another Simple-Talk article on index maintenance