<< Oracle 配置查询优化器 - liwenshui322的专栏 - 博客频道 - CSDN.NET | 首页 | Quickest way to convert XML to JSON in Java - Stack Overflow >>

简单介绍Oracle驱动表 - 51CTO.COM

CBO根据统计信息选择Oracle驱动表,假如没有统计信息,则在from 子句中从左到右的顺序选择Oracle驱动表。这与RBO选择的顺序正好相反。这是英文原文(CBO determines join order from costs derived from gathered statistics. If there are no stats then CBO chooses the driving order of tables from LEFT to RIGHT in the FROM clause. This is OPPOSITE to the RBO) 。

 

我还是没法证实这句话的正确性。不过经过验证:“如果用ordered 提示(此时肯定用CBO),则以from 子句中按从左到右的顺序选择Oracle驱动表”这句话是正确的。实际上在CBO中,如果有统计数据(即对表与索引进行了分析),则优化器会自动根据cost值决定采用哪种连接类型,并选择合适的Oracle驱动表,这与where子句中各个限制条件的位置没有任何关系。如果我们要改变优化器选择的连接类型或Oracle驱动表,则就需要使用 hints了,具体hints的用法在后面会给予介绍。

 

阅读全文……

标签 : ,



发表评论 发送引用通报