0

Can someone explain to me the reason a clustered index is required on Sql Server tables when moving them to another file group.

A table without a clustered index is stored as a heap where as adding a clustered index would change it to a B-Tree. Both heap and B Tree are tree-based data structures differing in the fact that B Tree is ordered. Why would this influence a table's file group changes?

Asking more out of curiosity rather than facing a active problem..Thanks

J Sidhu
  • 677
  • 1
  • 4
  • 19
  • A heap isn't a tree structure. It is just a bunch of leaves. But I'm not sure why whether it is a tree would be relevant to this anyway. I imagine it is probably because if the table has non clustered indexes they are more problematic for a heap as they contain the physical rid (coupled to the original physical location) not a logical key – Martin Smith Mar 05 '20 at 18:42
  • Thanks martin. I meant 'Tree based' data structure. corrected. – J Sidhu Mar 05 '20 at 18:51

0 Answers0