[英]What is a Clustered Index table?
I may be wrong, but it seems to be different opinions in the interwebs about what these are. 我可能错了,但在互联网上似乎有不同意见。 SQL Server, MySQL, DB2, and PostgreSQL show different definitions for these tables. SQL Server,MySQL,DB2和PostgreSQL显示了这些表的不同定义。
After reading a ton from different vendors (database manuals, user posts, etc.) I was able to distinguish three types of tables of interest (there are many, many more types of no interest for this question). 在阅读了不同供应商的数据(数据库手册,用户帖子等)之后,我能够区分出三种类型的感兴趣的表(对于这个问题,有许多,更多类型没有兴趣)。 Please bear with me: 请多多包涵:
Heap Table : 堆表 :
Pure Index Table : <-- Is this a Clustered Index Table? 纯索引表 :< - 这是一个聚集索引表吗?
Index + Sorted Heap Table : <-- Is this a Clustered Index Table? 索引+排序堆表 :< - 这是一个聚簇索引表吗?
Now, which ones of these #2 or #3 is a "Clustered Index Table"? 现在,这些#2或#3中的哪些是“聚集索引表”? Who's telling the truth and who's lying? 谁在说实话,谁说谎? :D :d
In other words, is the term "Clustered Index Table" a commercial term that each vendor freely defines as he/she pleases, or is there an official unique definition according to some official database theory? 换句话说,术语“聚集索引表”是一个商业术语,每个供应商可以根据他/她喜欢自由定义,还是根据某些官方数据库理论有官方唯一定义?
As far as I know, a "clustered index" is an index where the leaf nodes of the index are the data pages. 据我所知,“聚簇索引”是索引的叶节点是数据页的索引。 This is different from a non-clustered index where the leaf nodes are references to rows stored on the data pages. 这与非聚集索引不同,其中叶节点是对存储在数据页上的行的引用。
A table can have at most one clustered index. 一个表最多只能有一个聚簇索引。 In a table with a clustered index, the data is sorted on by the index keys. 在具有聚簇索引的表中,数据按索引键排序。
Postgres does not support clustered indexes. Postgres不支持聚簇索引。 It does have a table optimization called "cluster" that sorts the data based on an index. 它确实有一个名为“cluster”的表优化,它根据索引对数据进行排序。 However, this ordering is not maintained, so it is not the same as a clustered index. 但是,不保留此顺序,因此它与聚簇索引不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.