===========================================================
what is the clustering_factor ?
===========================================================
作者: bitirainy(http://bitirainy.itpub.net)
发表于: 2004.10.12 09:51
分类:
Oracle is anything
出处: http://bitirainy.itpub.net/post/330/2970
---------------------------------------------------------------
clustering_factor 是表征表中数据的存储顺序和某索引字段顺序的符合程度。
oracle 按照索引块中存储的rowid 来识别相临的索引中记录 在 表block中是否为相同块,如果索引中存在记录 rowid a,b,c,d……,若b 和 a 是同一个block,则比较 c 和 b,若这时不是同一个block,则clustering_factor + 1 ,然后比较 d 和 c,若还不是同一个 block,则clustering_factor + 1 ……
这样计算下来,clustering_factor 应该是介于 表 block数量 和 表记录数之间 的一个值,若 clustering_factor 接近 表block数量,则说明表中数据具有比较好的跟索引字段一样排序顺序的存储,通过索引进行 range scan 的代价比较小(需要读取的表块可能比较少),若clustering_factor 接近 row数量,则说明表中数据和索引字段排序顺序差异很大,杂乱无张。则通过索引进行 range scan 的代价比较大(需要读取的表块可能更多)。
当然,在oracle 920 开始,对于cluster_factor 比较接近表块数量的根据索引的大范围查询做了特别的处理,不再是读一个索引记录去搜索一个表记录了,而是成批处理(通过索引块一批rowid一次去表块中获得一批记录),这样就大大节约了读的成本( consistent gets)。
bitirainy
发表于:2004.10.12 09:51
::分类:
(
Oracle is anything
)
::阅读:(2248次)
::
评论
(7)
[回复]
字太小了,还得考出来看。
btw:怎么从字面上理解clustering,群,球;簇;束,组,串,团?聚合?
字面上老是往相反的方向想,好像clustering_factor越小,说明聚合程度小,都分散了,但实际上是相反的

grassbell
评论于: 2004.10.14 16:03
[回复]
字体太小.看得真累
husthxd
评论于: 2004.12.30 12:54
[回复]
楼上两位试试用firefox啊,加减号快速变换字体大小,很方便
我一直用他
eagle fan
评论于: 2005.02.15 14:56
[回复]
.... [control] + mouse scroll UP/DOWN
deWolf
评论于: 2005.08.22 11:01

re: what is the clustering_factor ?
[回复]
介于的范围应该是“表 block数量”还是“dba_indexes.leaf_block”和表记录数之间?
balakong
评论于: 2009.08.18 13:51

re: what is the clustering_factor ?
[回复]
介于的范围应该是“表 block数量”还是“dba_indexes.leaf_block”和表记录数之间?
balakong
评论于: 2009.08.18 13:53

re: what is the clustering_factor ?
[回复]
afsf
评论于: 2010.01.26 17:06