Oracle Query processing 的程序

Oracle Query processing 的程序

當一個查詢statement送出時,他的執行程序為:(from Jonathan Lewis web site)

  1. Perform syntax check
  2. Perform semantic check
  3. Perform hash function
  4. Perform library cache lookup
  5. If hash value found then
  6. .....If command is identical to existing one in cache then
  7. ..........If the objects referenced in the cached command are the same as the ones in the new command then
  8. ...............This is a soft parse, go to step 11
  9. This is a hard parse, build parse tree --&gt (parse 程序)
  10. Build execution plan
  11. Execute plan.

(parse 程序) Meta link 46234.1

[1] Syntactic - checks the syntax of the query

[2] Semantic - checks that all objects exist and are accessible

[3] View Merging - rewrites query as join on base tables as

opposed to using views

[4] Statement Transformation - rewrites query transforming some complex

constructs into simpler ones where

appropriate (e.g. subquery unnesting, in/or

transformation)

[5] Optimization - determines the optimal access path for the

query to take. With the Rule Based

Optimizer (RBO) it uses a set of heuristics

to determine access path. With the Cost

Based Optimizer (CBO) we use statistics

to analyze the relative costs of accessing

objects.

[6] Query Evaluation Plan Generation

重複的進行hard parse是非常消耗資源的,我們知道一個statement會先被算出一個hash值,然後去share pool找尋是否有相同的hash value statement來重複利用已解析過statement,並利用其執行計畫,statement如不好好使用bind variable加上share pool不足,儲存的statement終會被LRU演算法給踢除,這就會造成hard parse的增加了。

如果這個問題非常嚴重,在不能改寫程序的情況下,調整cursor sharing也許是不得已的方法了,不過要謹慎考量他的副作用。

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/779728/viewspace-926727/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/779728/viewspace-926727/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值