Uses of Key Compression【每日一译】--20121223

主键压缩在数据库索引中的应用包括非唯一规则索引、唯一索引和索引组织表中,通过压缩重复的主键值来优化存储效率。此技术在处理大量重复数据时尤其有效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Key compression is useful in many different scenarios, such as:
■ In a nonunique regular index, Oracle stores duplicate keys with the rowid
appended to the key to break the duplicate rows. If key compression is used,
Oracle stores the duplicate key as a prefix entry on the index block without the

rowid. The rest of the rows are suffix entries that consist of only the rowid.

主键压缩在许多不同的场景中是非常有用的,比如:

#在一个非唯一的规则索引中,O存储重复主键和使用ROWID值追加到主键去打破重复行。

如果键压缩被使用,O存储重复主键值作为一个前缀条目在索引块上而不包含ROWID。

剩下的行的后缀条目仅由ROWID组成。

■ This same behavior can be seen in a unique index that has a key of the form (item,
time stamp), for example (stock_ticker, transaction_time). Thousands of
rows can have the same stock_ticker value, with transaction_time
preserving uniqueness. On a particular index block a stock_ticker value is
stored only once as a prefix entry. Other entries on the index block are
transaction_time values stored as suffix entries that reference the common

stock_ticker prefix entry.

#这个相同的行为可以在唯一索引中看见。它拥有一个主键形式(ITEM,TIME STAMP),比

如(STOCK_TICKER,TRANSACTION_TIME)。几条行可以拥有相同的STOCK_TICKER值,

使用TRANSACTION_TIME预值唯一值。在一个特殊索引块一个STOCK_TICKER值是仅作为

一个前缀条目存储。其它条目在索引块上是以TRANSACTION_TIME的值作为后缀存储条目,

它涉及普通STOCK_TICKER的前缀条目。

■ In an index-organized table that contains a VARRAY or NESTED TABLE datatype,
the object identifier is repeated for each element of the collection datatype. Key
compression lets you compress the repeating object identifier values.
In some cases, however, key compression cannot be used. For example, in a unique
index with a single attribute key, key compression is not possible, because even though

there is a unique piece, there are no grouping pieces to share.

一个索引组织表它包含一个数组或者嵌套表数据类型,对象的标识是重复的对于每个集合数据

类型元素。主键压缩让你压缩重复的对象标识值。有一些情况里,相反的,主键压缩不能被使用,

比如,在一个唯一索引拥有一个单独的属性主键,主键压缩是不可能的,因为尽管有一个唯一的片,

而没有分组的片拿去共享。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值