关于oracle hint 值得注意的地方

大家都知道oracle hint如何用, 但是有些小细节,希望对大家有用

1.first_row(n)

The optimizer ignores this hint in DELETE and UPDATE statement blocks and in SELECT statement blocks that include any blocking operations, such as sorts or groupings

此时不能有分组和排序,意思是只能用于比如详单的查询,否则失效。

 

2. DYNAMIC_SAMPLING

If there is no single-table predicate (a WHERE clause that evaluates only one table), then the optimizer trusts the existing statistics and ignores this hint.

在没有统计信息的情形下,动态采样是非常的利器,但是单表而没有谓词的情形,失效。

 失效:
SELECT /*+ dynamic_sampling(e 1) */ count(*) 
  FROM employees e;

有效:

SELECT /*+ dynamic_sampling(employees 1) */ * 
  FROM employees 
  WHERE ...


3.Only two hints are used with INSERT statements: The APPEND hint always follows the INSERT keyword, and the PARALLEL hint can follow the INSERT keyword

insert, 只能有append parallel hint可用

 

 

4. 一建考试要点

http://wenku.baidu.com/view/e5b0063f580216fc700afd32.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值