RBO(基于规则的优化器)遵循简单的分级方法学,使用15种级别要点,当接收到查询,优化器将评估使用到的要点数目,然后选择最佳级别(最少的数量)的执行路径来运行查询,它不考虑对象尺寸、列的基数、数据的分布、排序区尺寸及其它因素。
RBO Path 1: Single Row by Rowid(等级最高)
RBO Path 2: Single Row by Cluster Join
RBO Path 3: Single Row by Hash Cluster Key with Unique or Primary Key
RBO Path 4: Single Row by Unique or Primary Key
RBO Path 5: Clustered Join
RBO Path 6: Hash Cluster Key
RBO Path 7: Indexed Cluster Key
RBO Path 8: Composite Index
RBO Path 9: Single-Column Indexes
RBO Path 10: Bounded Range Search on Indexed Columns
RBO Path 11: Unbounded Range Search on Indexed Columns
RBO Path 12: Sort Merge Join
RBO Path 13: MAX or MIN of Indexed Column
RBO Path 14: ORDER BY on Indexed Column
RBO Path 15: Full Table Scan(等级最低)
-------------------------------------------------------
1级:用Rowid定位单行
2级:用Cluster Join定位单行
3级:用带用唯一约束或做主键的Hash Cluster Key定位单行
4级:用唯一约束的字段或做主键的字段来定位单行
5级:Cluster Join
6级:使用Hash Cluster Key
7级:使用索引Cluster Key
8级:使用复合索引
9级:使用单字段索引
10级:用索引进行有界限范围的查找
11级:用索引字段进行无界限的查找
12级:排序合并连接
13级:对索引字段使用MAX或MIN函数
14级:ORDER BY索引字段
15级:全表扫描
上面的执行路径中,RBO认为越往下执行的代价越大,即等级越低。在RBO生成执行计划时,如果它发现有等级高的执行路径可用,则肯定会使用等级高的路径,而不管任何其它影响性能的元素,即RBO通过上面的路径的等级决定执行路径的代价,执行路径的等级越高,则使用该执行路径的代价越小。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12330444/viewspace-310412/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12330444/viewspace-310412/