MAPPING TABLE 的作用

 

MAPPING TABLE 的作用  

Oracle supports bitmap indexes on partitioned and nonpartitioned index-organized tables.A mapping table is required for creating bitmap indexes on an index-organized table.

Mapping TableThe mapping table is a heap-organized table that stores logical rowids of the index-organized table. Specifically,each mapping table row stores one logical rowid for the corresponding index-organized table row. Thus,the mapping table provides one-to-one mapping between logical rowids of the index-organized table rows and physical rowids of the mapping table rows.

A bitmap index on an index-organized table is similar to that on a heap-organized table except that the rowids used in the bitmap index on an index-organized table are those of the mapping table as opposed to the base table. There is one mapping table for each index-organized table and it is used by all the bitmap indexes created on that index-organized table.

In both heap-organized and index-organized base tables, a bitmap index is accessed using a search key. If the key is found, the bitmap entry is converted to a physical rowid. In the case of heap-organized tables, this physical rowid is then used to access the base table. However, in the case of index-organized tables, the physical rowid is then used to access the mapping table. The access to the mapping table yields a logical rowid. This logical rowid is used to access the index-organized table.

Though a bitmap index on an index-organized table does not store logical rowids, it is still logical in nature.

你创建了一个IOT 表,想在上面的其中一列建立位图索引,你必须建立一
个mapping table
注意到Mapping table 是个heap table, 用来存储IOT table 的logical
rowid (primary key)。 Mapping table 的每一行存储了对应的IOT 表中记录
的logical rowid.
因此这个mapping table 就维护了IOT 表logical rowid 和 mapping table
的每一行的physical rowid 的mapping 的关系。为什么要这样做呢?
因为bitmap 索引条目中保存的rowid 要用physical rowid, 而IOT 是无法
提供稳定的physical rowid 的,因此就借助于mapping table 的physical rowid。
通过bitmap 索引来访问表中的数据的执行计划大概就是首先根据bitmap
index 中的physical rowid 访问mapping table, 然后通过mapping table 中的
logical rowid 再来访问IOT 表。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值