optimizer_dynamic_sampling 中的Level 1,2 的解释

对于Oracle9i (9.2) , 10g 中 optimizer_dynamic_sampling 涉及的Level 1, 2 解释不是太清楚 。


不知道下面的解释是否正确 ?  

Oracle9i ,  默认是Level 1 , 单个table 的时候优化器动态采样就不起作用,多个关联表都没有分析也不起作用,只有关联表中有一个或几个表有分析,优化器动态采样才起作用 。  下面英文中写着这个没有分析的table 需要满足没 index , 需要这个条件么 ?  9i , 10g 有区别没 ?   

Oracle10g 默认是Level 2 , 不管是否单表,还是都没有分析的表,优化器动态采样都起作用 。


优化器动态采样的数据块数目又怎样解释  ?  为什么Oracle会定义默认采样 32 Blocks , 有什么方面的考虑 ? 然后level 3, 4, .... 好像都是32的倍数来的 。 还有动态采样顾名思意应该是每次执行都需要采样一次,分析后的数据临时存储在哪里 ? 执行session 结束后就删除还是这些分析数据就存在内存中, 随执行session 的消失而消失 。   



原文 :
----------------------------------

Level 1:    Sample all tables that have not been analyzed if the following criteria are met: (1) there is at least 1 unanalyzed table in the query;    (2) this unanalyzed table is joined to another table or appears in a subquery or non-mergeable view;   (3) this unanalyzed table has no indexes;    (4) this unanalyzed table has more blocks than the number of blocks that would be used for dynamic sampling of this table. The number of blocks sampled is the default number of dynamic sampling blocks (32).   


Level 2:      Apply dynamic sampling to all unanalyzed tables. The number of blocks sampled is the default number of dynamic sampling blocks.

[ 本帖最后由 tolywang 于 2009-4-30 16:16 编辑 ]
请使用浏览器的分享功能分享到微信等