hai 的个人资料Oracle & Starcraft日志列表 工具 帮助
1月24日

hash join 与 10104 event

OPTIMAL MODE:

 Optimal方式的hash join相对来说非常简单,在这个例子(optimal.doc)里面,一共需要2partition,这也是hash join中最小的partition分配数,随着work area的增大,partition的数目也会增多,partition的分配规律遵守2n次方这样的规则分配。在经过build tablescan以后,hash table被建立,每条记录被hash后对应的hash bucket也被填充,与此相对应的bitmap vectorbit位也被设置,这个时候开始probe tablescan,首先通过同样的hash functionjoin key进行运算,然后对比bitmap vector中的bit是否被标志,如果没被标志那么表示这条记录不符合关联的要求直接被丢弃。如果bit位被设置,那么表示这个值可能与hash bucket中保存的值一致,因为hash算法会有碰撞,所以一个bucket中会有不同的值存在,所以将会对比这个值和hash bucket中保存的值是不是相同,如果相同那么输出给客户端,等probe table扫描完毕,所有结果都输出给客户端。

 

optimal.doc  点击下载trace 文件

ONEPASS MODE:


当我们修改了hash_area_size2m后,hash join的运行模式变成了onepass状态,从上面的trace(onepass.doc)文件中可以发现,partition变成了4

### Partition Distribution ###

Partition:0    rows:49933      clusters:5      slots:1      kept=0

Partition:1    rows:49674      clusters:5      slots:1      kept=0

Partition:2    rows:49943      clusters:5      slots:4      kept=0

Partition:3    rows:50451      clusters:5      slots:5      kept=1


其中partition 3可以被放在work area中,其他几个partition不可避免的要写出到磁盘上。接下来开始probe tablescan,在扫描的过程中经过bitmap vector的过滤,不符合的记录被丢弃,因为bitmapVector中也保存了每个hash bucket是否在内存还是在磁盘,所以符合的记录就会去查到底这个hash bucket位于哪里,如果在内存,直接比较确切值,丢弃或者输出给客户端(从trace文件中看不出这个过程,trace文件看起来是dump所有不能放入内存的partitition,然后读入partition pairhash join)。如果在磁盘,那么probe table的这条记录也写出到磁盘,形成一个partition pair
partition 3的数据join完毕,接下来是partition 2的所有部分被读入内存,同时probe table相对的partition也被读入内存进行hash join,然后是partition 1,partition 0。可以看到这里都只读了一次probe table partition,所以我们称之为onepass hash join.

onepass.doc  点击下载trace 文件

MULTIPASS MODE:


 这个就是multipass hash join的过程,trace文件异常的长,首先分配了2partitions,没有一个partition能被完全放在work area里面

### Partition Distribution ###

 Partition:0    rows:99876      clusters:10     slots:1      kept=0

Partition:1    rows:100125     clusters:10     slots:4      kept=0

首先是build tablescan Work area里面容纳了partition 14slotpartition 0的一个slot,另外还有一个slot是为了i/o用的。每当一个slot(可能是一个block)满后将会被写出到磁盘,等build table scan完毕,磁盘上保存了2partition的内容,并且bitmap vector也被建立了。这时开始了probe tablescan,系统为probe table的每个partition分配了一个slot,还分配一个slot作为读入probe table的缓冲,通过bitmap vector的过滤,符合条件的记录被填充到probe partitionslot中并与build table partitionslot来比较确切值。这个步骤完了以后work area里面应该存在一个build table partition 0slot,一个build table partition 1slot,一个写出缓冲的slot,一个读入缓冲的slot,一个probe table partition 0slot,一个probe table partition 1slot,一共6slot,刚好填满所有可分配的slot。这个过程中间可能会有在内存中匹配的行返回,然后开始从磁盘读取partition pair开始join,经过10probe partition的读取。partition 0也是经过了10probe partition的读取,这就带来了很多i/o,导致hash join的性能急剧下降。Oracle在进行multipass的过程中会有2hash function的存在。Oracle将会读入磁盘上的build table partition再进行一次hash生成一些subpartition,这样的话每次读入probe table subpartition即可,而不用多次读入probe partition导致过大的i/o.不过在这个trace文件中并没有发现这个过程。的个和的一个另外还有一个是为了用的。每当一个(可能是一个)满后将会被写出到磁盘,等完毕,磁盘上保存了个的内容并且也被建立了。这时开始了的,系统为的每个分配了一个,还分配一个作为读入的缓冲,通过的过滤,符合条件的记录被填充到的中并与的来比较确切值。这个步骤完了以后里面应该存在一个的,一个的,一个写出缓冲的一个读入缓冲的,一个的,一个的,一共个,刚好填满所有可分配的。这个过程中间可能会有在内存中匹配的行返回,然后开始从磁盘读取开始,经过次的读取。也是经过了次的读取,这就带来了很多,导致的性能急剧下降。在进行的过程中会有次的存在。将会读入磁盘上的再进行一次生成一些,这样的话每次读入即可,而不用多次读入导致过大的不过在这个文件中并没有发现这个过程。里面容纳了的个和的一个另外还有一个是为了用的。每当一个(可能是一个)满后将会被写出到磁盘,等完毕,磁盘上保存了个的内容并且也被建立了。这时开始了的,系统为的每个分配了一个,还分配一个作为读入的缓冲,通过的过滤,符合条件的记录被填充到的中并与的来比较确切值。这个步骤完了以后里面应该存在一个的,一个的,一个写出缓冲的一个读入缓冲的,一个的,一个的,一共个,刚好填满所有可分配的。这个过程中间可能会有在内存中匹配的行返回,然后开始从磁盘读取开始,经过次的读取。也是经过了次的读取,这就带来了很多,导致的性能急剧下降。在进行的过程中会有次的存在。将会读入磁盘上的再进行一次生成一些,这样的话每次读入即可,而不用多次读入导致过大的不过在这个文件中并没有发现这个过程。另外还有一个trace文件反映了ROLE REVERSALoracle在进行join时会去评估build partitionprobe partition的大小,如果发行probe partition小于build partition,那么会对换两者的角色,对原来的probe partition建立hash table,拿原来的build partition来匹配,这种方法也在一定程度上减少了i/o,提高了效率。

*** HASH JOIN GET FLUSHED PARTITIONS (PHASE 2) ***

 Getting a pair of flushed partions.  

BUILD PARTION: nrows:24948 size=(3 slots, 384K) 

PROBE PARTION: nrows:12410 size=(2 slots, 256K)    

ROLE REVERSAL OCCURRED


### Hash table overall statistics ###
Total buckets: 262144 Empty buckets: 250012 Non-empty buckets: 12132
Total number of rows: 12410
Maximum number of rows in a bucket: 3
Average number of rows in non-empty buckets: 1.022915

multipass.doc  点击下载trace 文件

上面这些只是本人基于trace文件对hash join运行模式的推断,不一定能反正hash join真实的运行情况,所以欢迎大家来讨论!  

评论 (8)

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

雨儿发表:

http://www.batteryfast.com/dell/inspiron-9300.htm dell inspiron 9300 battery
http://www.batteryfast.com/hp/dv8000.htm hp dv8000 battery
http://www.batteryfast.com/hp/dv1000.htm hp dv1000 battery
http://www.batteryfast.com/hp/dv4000.htm hp dv4000 battery
http://www.batteryfast.com/hp/r3000.htm hp r3000 battery
http://www.batteryfast.com/dell/inspiron-mini-9.htm dell inspiron mini 9 battery
http://www.batteryfast.com/dell/inspiron-9400.htm dell inspiron 9400 battery
http://www.batteryfast.com/acer/aspire-5520.htm acer aspire 5520 battery
http://www.batteryfast.com/acer/aspire-5920.htm acer aspire 5920 battery
http://www.batteryfast.com/dell/inspiron-6400.htm dell inspiron 6400 battery
http://www.batteryfast.com/ibm/thinkpad-x60.htm ibm thinkpad x60 battery
http://www.batteryfast.com/ibm/thinkpad-x60s.htm ibm thinkpad x60s battery
http://www.batteryfast.com/hp/zt3000.htm hp zt3000 battery
http://www.batteryfast.com/hp/pavilion-zv5000.htm hp pavilion zv5000 battery
http://www.batteryfast.com/hp/pavilion-zv6000.htm hp pavilion zv6000 battery
http://www.batteryfast.com/hp/pavilion-zd8000.htm hp pavilion zd8000 battery
http://www.batteryfast.com/hp/pavilion-zx5000.htm hp pavilion zx5000 battery
http://www.batteryfast.com/hp/presario-v4000.htm hp presario v4000 battery
http://www.batteryfast.com/hp/presario-v2000.htm hp presario v2000 battery
http://www.batteryfast.com/hp/presario-m2000.htm hp presario m2000 battery
http://www.batteryfast.com/compaq/presario-v4000.htm compaq presario v4000 battery
http://www.batteryfast.com/compaq/presario-v2000.htm compaq presario v2000 battery
http://www.batteryfast.com/compaq/presario-v3000.htm compaq presario v3000 battery
http://www.batteryfast.com/compaq/presario-v6000.htm compaq presario v6000 battery
http://www.batteryfast.com/compaq/presario-c700.htm compaq presario c700 battery
http://www.batteryfast.com/dell/fk890.htm dell fk890 battery
http://www.batteryfast.com/toshiba/pa3593u-1bas.htm toshiba pa3593u-1bas battery
http://www.batteryfast.com/hp/m2000.htm hp m2000 battery
http://www.batteryfast.com/hp/338794-001.htm hp 338794-001 battery
http://www.batteryfast.com/hp/395789-001.htm hp 395789-001 battery
http://www.batteryfast.com/compaq/116314-001.htm compaq 116314-001 battery
http://www.batteryfast.com/toshiba/satellite-a70.htm toshiba satellite a70 battery
http://www.batteryfast.com/compaq/319411-001.htm compaq 319411-001 battery
http://www.batteryfast.com/hp/346970-001.htm hp 346970-001 battery
http://www.batteryfast.com/hp/367759-001.htm hp 367759-001 battery
http://www.batteryfast.com/hp/411462-421.htm hp 411462-421 battery
http://www.batteryfast.com/hp/ev088aa.htm hp ev088aa battery
http://www.batteryfast.com/hp/ex941aa.htm hp ex941aa battery
http://www.batteryfast.com/laptop battery
http://www.batteryfast.com/laptop batteries
http://www.batteryfast.com/dell laptop batteries/
http://www.batteryfast.com/dell/wr050.htm dell wr050 battery
http://www.batteryfast.com/hp laptop batteries/
http://www.batteryfast.com/laptop ac adapter/

11 月 7 日
http://www.batterylaptoppower.com/uniwill/n251s1.htm uniwill n251s1 battery
http://www.batterylaptoppower.com/gateway/s62066l.htm gateway s62066l battery
http://www.batterylaptoppower.com/ibm/t40.htm ibm t40 battery
http://www.batterylaptoppower.com/ibm/t43.htm ibm t43 battery
http://www.batterylaptoppower.com/hp/2230.htm hp 2230 battery
http://www.batterylaptoppower.com/toshiba/pa3331u-1brs.htm toshiba pa3331u-1brs battery
http://www.batterylaptoppower.com/toshiba/pa3331u-1bas.htm toshiba pa3331u-1bas battery
http://www.batterylaptoppower.com/toshiba/satellite-m30.htm toshiba satellite m30 battery
http://www.batterylaptoppower.com/toshiba/pa3480u-1brs.htm toshiba pa3480u-1brs battery
http://www.batterylaptoppower.com/toshiba/p100.htm toshiba p100 battery
http://www.batterylaptoppower.com/toshiba/p105.htm toshiba p105 battery
http://www.batterylaptoppower.com/toshiba/pa3479u-1brs.htm toshiba pa3479u-1brs battery
http://www.batterylaptoppower.com/mitac/bp-8089x.htm mitac bp-8089x battery
http://www.batterylaptoppower.com/mitac/bp-8389.htm mitac bp-8389 battery
http://www.batterylaptoppower.com/mitac/bp-8089p.htm mitac bp-8089p battery
http://www.batterylaptoppower.com/mitac/bp-8599.htm mitac bp-8599 battery
http://www.batterylaptoppower.com/toshiba/b404.htm toshiba b404 battery
http://www.batterylaptoppower.com/toshiba/ba1405.htm toshiba ba1405 battery
http://www.batterylaptoppower.com/toshiba/1800.htm toshiba 1800 battery
http://www.batterylaptoppower.com/toshiba/4000.htm toshiba 4000 battery
http://www.batterylaptoppower.com/toshiba/pa3128u.htm toshiba pa3128u battery
http://www.batterylaptoppower.com/toshiba/pa3191u.htm toshiba pa3191u battery
http://www.batterylaptoppower.com/hp/nc6000.htm hp nc6000 battery
http://www.batterylaptoppower.com/hp/nx5000.htm hp nx5000 battery
http://www.batterylaptoppower.com/hp/nw8000.htm hp nw8000 battery
http://www.batterylaptoppower.com/hp/v1000.htm hp v1000 battery
http://www.batterylaptoppower.com/sony/vgp-bpl2c.htm sony vgp-bpl2c battery
http://www.batterylaptoppower.com/toshiba/pa3451u.htm toshiba pa3451u battery
http://www.batterylaptoppower.com/toshiba/pa3457u.htm toshiba pa3457u battery
http://www.batterylaptoppower.com/toshiba/pabas067.htm toshiba pabas067 battery
http://www.batterylaptoppower.com/toshiba/satellite-x200.htm toshiba satellite x200 battery
http://www.batterylaptoppower.com/hp/hstnn-db36.htm hp hstnn-db36 battery
http://www.batterylaptoppower.com/hp/b1900.htm hp b1900 battery
http://www.batterylaptoppower.com/hp/hstnn-db02.htm hp hstnn-db02 battery
http://www.batterylaptoppower.com/hp/dp399a.htm hp dp399a battery
http://www.batterylaptoppower.com/acer/btp-63d1.htm acer btp-63d1 battery
http://www.batterylaptoppower.com/acer/aspire-3020.htm acer aspire 3020 battery
http://www.batterylaptoppower.com/acer/aspire-3610.htm acer aspire 3610 battery
http://www.batterylaptoppower.com/compaq/nw8000.htm compaq nw8000 battery
http://www.batterylaptoppower.com/compaq/nc8000.htm compaq nc8000 battery
http://www.batterylaptoppower.com/compaq/v1000.htm compaq v1000 battery
http://www.batterylaptoppower.com/compaq/nx5000.htm compaq nx5000 battery
http://www.batterylaptoppower.com/compaq/n600.htm compaq n600 battery
http://www.batterylaptoppower.com/compaq/n610c.htm compaq n610c battery
11 月 3 日
8 月 28 日
没有名字发表:
Key words click link to see (wow power leveling) and (wow gold) the discounted prices!
9 月 17 日
没有名字发表:

Amberdigital Branch,Southern Stars Enterprises Co is specializing in the development and manufacturing of advertising displays, advertising player and LCD displays. Established in 1996, we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.

amberdigital Contact Us
Southern Stars Enterprises Co (Hong Kong Office)
Add:3 Fl, No.2, Lane 2, Kam Tsin Tsuen, Sheung Shui, Hong Kong
Tel:+852 2681 4099
Fax:+852 2681 4586

Southern Stars Enterprises Co (Shenzhen Office)
Add:DE, 16/F, Building 2, Nanguo Tower, Sungang Road, Shenzhen, China
Tel:+86 755 2592 9100
Fax:+86 755 2592 7171

E-mail:sstar@netvigator.com
website:www.amberdigital.com.hk
alibaba:amberdigital.en.alibaba.com[cifgecidbefc

8 月 28 日
3 月 26 日
wanghai发表:
ONEPASS MODE 的每个build table partition都只和它自己对应的probe table partition比较,不会和其他build table partition对应的probe table partition比较,这里有个partition pair的概念。
3 月 12 日
匿名 的图片
乙骨文 发表:
在ONEPASS MODE 应该是每个build table partition都要和probe table partition比较吗?那这个probe table partition不就是被访问了4次了吗?
3 月 9 日

引用通告

此日志的引用通告 URL 是:
http://wzwanghai.spaces.live.com/blog/cns!56626E237AFBD116!362.trak
引用此项的网络日志