ITPub博客

首页 > 应用开发 > IT综合 > Uses of Key Compression (218)

Uses of Key Compression (218)

原创 IT综合 作者:tsinglee 时间:2007-11-19 11:13:08 0 删除 编辑

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.
■ 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.
■ 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.

使用键压缩
键压缩在很多不同的情况下非常有用 ,例如:
1. 对于非唯一索引Oracle 会在每个重复的索引键之后添加 rowid 以便区分。如果使用了键压缩,在一个
索引块内,Oracle 只需将重复的索引键作为前缀存储一次,并用各行的 rowid 作为后缀
2. 唯一索引与非唯一索引的情况类似
3. 在一个包含 VARRAY 或 NESTED TABLE 数据类型的索引组织表中 ,这些聚集 类型中各个元素是重复的,
可以使用键压缩以避免重复存储这些对象标识符
4. 有些情况无法使用键压缩。例如,一个只有一个索引键的唯一索引就无法使用键压缩,
因为索引键中不存在可供共享的分组片段。

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-982962/,如需转载,请注明出处,否则将追究法律责任。

上一篇: What Is OC4J
请登录后发表评论 登录
全部评论
  • 博文量
    740
  • 访问量
    1897659