文档详情

ORACLE培训资料_数据仓库优化.ppt

发布:2018-05-10约9.01千字共55页下载文档
文本预览下载声明
数据仓库优化 一、位图索引 Rowid Restricted Rowid 用6个字节表示。 索引用的rowid,start Rowid,end Rowid 都是restricted Rowid 位图索引start Rowid表示表记录的第一条(并不是符合健值的第一条记录);end Rowid表示符合健值的最后一条记录所在字节的最后一位,因此end Rowid 是以7或f结尾。 位图索引 位图索引也按B树形式组织,但是叶块存储的是每个健值的位图,而不是rowid。 位图索引包含所有列值为空的索引位图,这与B树索引不同。 位图索引并不是每个健值占用一个数据块,可能多个健值位于同一数据块。 Insert (或 delete) 只影响到该健值索引位图,而其它健值索引位图不会变。而且同时只能有一个事务插入同样健值记录(会引起tx锁)。 不同值越多,位图索引所占用总空间就越大;而每个位图值所占用空间却可能越小。建位图索引前,如果先对数据进行排序,可很大程度减小索引空间占用。 每个位图索引块最多只能用一半空间,这是由于Insert (或 delete) 会在索引块中拷贝索引位图(位图更新会删除原拷贝),同一事务中多个insert会产生多个拷贝,严重影响性能 。 位图索引 由于位图是以8位长度扩展的,因此,有可能出现9条记录,但位图段却有16位。 转化后的位置并不是真实的物理位置,在每个字节内部bit还要颠倒一下顺序,首字节(对于不是第一块,2个字节)不表示位置信息。 对于数据所在不同数据块,位图段用2个字节表示,结合start rowid、 end rowid信息,以及数据位位置,可以很容易确定某条记录rowid信息。这使得由位图向rowid转换成为可能,而且,转换代价很低。 位图索引 Because there is only one lock byte for the entire entry, which means a single lock will have impact on all rows cover by this entry. updating the indexed column of one row in the table can cause fromlist and tolist to be locked. if our updates do not affect the bitmapped column, the presence of the bitmap indexes causes no problems . A simple update to a single row typically results in an entire bitmap section being copied. even a serialized batch update will be most effective if you drop the bitmap indexes before the batch and rebuild them afterwards. Bitmap Conversion Count 星形转换 星形转换是基于CBO的转换,也就是说在RBO环境下,必须使用STAR提示。 星形查询是由一个事实表与多个维表连接形成,并且维表之间不相互连接。如: 1st Phase:转换为 ST执行过程 A dimension table predicate is executed to return a subset of rows from the dimension For each value in the return set, a bitmap index is retrieved for the corresponding fact table column (bitmap key iteration step) Bitmap merge operation is performed for all bitmap values through a bitmap or operation Previous 3 steps are repeated for the remaining dimension tables with predicate constraints Bitmap elimination of all bitmap merge values of all fact rows not joining all dimension tables are done through a bitmap and operation (bitmap and) The final, mer
显示全部
相似文档