What does this sentence mean: Clustered indexes are stored physically on the table?

后端 未结 6 631
予麋鹿
予麋鹿 2020-12-29 07:58

How are clustered indexes stored on a hard disk? What is the logical order?

How do non-clustered indexes work?

6条回答
  •  一生所求
    2020-12-29 08:18

    For non-clustered indexes, a separate file is created, which hold just the index fields, which has it's records placed in the logical index order. For clustered index, there is no separate file -- the data from the table itself (all the fields) is placed in the logical order of the index.

    This makes lookup on the index faster (though it's really best of indexes like dates where you'll be looking up a range). It also makes inserts rather slow if the record will be inserted in the middle.

提交回复
热议问题