这句话是什么意思:聚集索引物理存储在表上? [英] What does this sentence mean: Clustered indexes are stored physically on the table?

查看:160
本文介绍了这句话是什么意思:聚集索引物理存储在表上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

群集索引如何存储在硬盘上?什么是逻辑顺序?

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

非聚集索引如何工作?

推荐答案

这意味着表中的数据根据​​ CLUSTERED PRIMARY KEY的顺序存储在 B-Tree (或聚类列)。

This means that the data in the table are stored in a B-Tree according to the order of the CLUSTERED PRIMARY KEY (or the clustering columns).

这个名字在我看来有点令人困惑。 Oracle 中的相同概念称为索引组织表,我发现它更具描述性。

This name is in my opinion a little bit confusing. The same concept in Oracle is called index-organized table which I find much more descriptive.

非聚集索引包含索引列的值以及指向它们源自的记录的指针。

Non-clustered indexes contain the value of the indexed columns along with the pointer to the record they are originated from.

聚簇 index是表格本身; 非聚集索引是某些表列的有序副本。

The "clustered index" is the table itself; the "non-clustered" index is an ordered copy of some of the table's columns.

如果创建聚簇索引,则会重新排列表。这就是为什么你不能在一个表上拥有多个聚集索引:该表不能以多个顺序排列。

If you "create" a clustered index, the table is rearranged. That's why you cannot have more than one "clustered index" on a table: the table cannot be arranged in more than one order.

如果你创建了一个二级索引,创建表的卷影副本,保存索引列的值和指向它们的记录的指针。每当表更改时,副本也会更改(引擎会自动处理)。

If you create a secondary index, the shadow copy of the table is created, holding the values of the indexed columns and the pointers to the records they are from. Whenever the table changes, the copy is changed too (the engine takes care of that automatically).

id   col1   value
--   --     --
1    1      Data 1
6    1      Data 6
3    1      Data 3
7    2      Data 7
9    2      Data 9
5    2      Data 5

该表未订购。

id   col1   value
--   --     --
1    1      Data 1
3    1      Data 3
5    2      Data 5
6    1      Data 6
7    2      Data 7
9    2      Data 9

该表在 id 。

Table                      Index
id   col1   value          col1   id
--   --     --             --     --
1    1      Data 1         1      1
3    1      Data 3         1      3
5    2      Data 5         1      6
6    1      Data 6         2      5
7    2      Data 7         2      7
9    2      Data 9         2      9

该表是 id 上的订货人,该指数在<$ c $上订购c>(col1,id)

The table is orderer on id, the index is ordered on (col1, id)

这篇关于这句话是什么意思:聚集索引物理存储在表上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆