oracle的驱动在哪,简单介绍Oracle驱动表

Oracle有很多值得学习的地方,这里我们主要介绍Oracle驱动表,包括介绍hints的用法等方面。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的用法在后面会给予介绍。

如果我创建的3个表:create table A(col1 number(4,0),col2 number(4,0), col4 char(30));

create table B(col1 number(4,0),col3 number(4,0), name_b char(30));

create table C(col2 number(4,0),col3 number(4,0), name_c char(30));

create index inx_col12A on a(col1,col2);

执行查询:select A.col4

from B, A, C

whereB.col3=10

andA.col1=B.col1

andA.col2=C.col2

andC.col3=5;

Execution Plan

【编辑推荐】

【责任编辑:志京 TEL:(010)68476606】

点赞 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值