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

后端 未结 6 659
予麋鹿
予麋鹿 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:11

    Primary indexes are not technically "clustered" indexes, though both cause a physical sort ordering to the data. The difference is apparent in their very names. A primary index deals with primary keys. Meaning, each primary key must be unique (otherwise it would not be a primary key). A clustering index deals with anything that is not a primary key and, by definition, may be allowed to be non-unique. This is where the word "cluster" comes from. If you sort data that is not primary, it means it can repeat. When repeated data appears together, it is considered a "cluster."

提交回复
热议问题