db2的位图索引

[color=red]DB2 的位图索引[/color]



Generally, DBAs ask the equivalent of Oracle's bitmap indexes in DB2. DB2 optimizer takes away the burden of creating / maintaining bitmap indexes as it creates them on the fly when it needs them.

[color=red]一般来说,数据库管理员们要求DB2的位图索引与Oracle的相同。 DB2优化器承担了创建或维护位图索引的重担,当需要位图索引时它能迅速的创建出来。[/color]



How do you know if DB2 optimize is using bitmap index or not?

[color=red]你该如何得知DB2优化是否正在使用位图索引呢?[/color]



David Sciaraffa explains that you can know about it by looking at the explain plan for the query. One of the example is shown below

[color=red]David Sciaraffa解释说,你可以通过查看查询语句的‘执行计划’来了解情况。下面是一个实例:[/color]



FETCH

/ \

RIDSORT fact table

/

IXAND ----> This is where the "bitmaps" are ANDed

/ | \

NLJN NLJN

/ \ ... / \

D1 IF1 Dn IFn

Note:

IF1 .. IFn are indexes on the fact table that provide

the RIDs used for the bitmap ANDing

D1 ...Dn are dimension tables .... could be accessed

in different ways.




Generally as a DBA, you might have created a bitmap index in Oracle on a low cardinality column but DB2 does this automatically for you.

[color=red]作为一个数据库管理员,通常在Oracle中你也许需要在低基数列下创建位图索引,而DB2则可以自动创建。[/color]



The problem with static bit map indexes is - you require many of them and they impact the updating of data. An insert, update, delete needs to update all the indexes. DB2 researchers made a decision many years ago to go with dynamic bit map indexes.

[color=red]静态位图索引的问题是,你需要有很多并且它们会影响数据的更新。每一次的插入、更新、删除都需要更新所有索引。 DB2研究人员在多年前就决定采用动态位图索引。[/color]



There is no disk or update overhead and DB2 can give you similar performance by accessing the index and handling the RIDS in memory. In addition to bitmap indexes, DB2 have hash joins which are lightening fast if you have the memory for them. Basically the same as bit map indexing.

[color=red]不需要任何硬盘或更新开销,DB2可以给你相同的体验,仅仅通过访问索引和处理内存中的RIDS。除了位图索引,DB2还有哈希关联—如果你提供内存,它也会非常快。基本上和位图索引是相同的。[/color]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值