oracle_plsql_优化3.ppt

  1. 1、本文档共83页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
oracle_plsql_优化3

15 May 2001 TENDER DC0101 Workshops DAY3: Workshops Workshop Workshop Bind Variables Oracle performs a CPU intensive hard parse for all new statements Statements already present in the shared pool only require a soft parse Statement matching uses “Exact Text Match”, so literals, case and whitespaces are a problem. bind_variable_usage.sql Unnecessary parses waste CPU and memory bind_performance.sql Workshop Workshop Bind Variables – Cursor Sharing Cursor sharing reduces the impact of literals Bind variables are substituted for literals cursor_sharing.sql Cursor sharing is unnecessary if you do the job properly. Cursor sharing introduces other costs May cause performance issues in some code Workshop Workshop Bind Variables – Dynamic Binds Complex dynamic SQL can make using bind variables difficult and ugly dynamic_binds_setup.sql dynamic_binds_test.sql Contexts allow you to reduce code complexity. dynamic_binds_setup_2.sql dynamic_binds_test.sql Query transformation allows complex dynamic SQL to still use bind variable dynamic_binds_setup_3.sql dynamic_binds_test.sql Workshop Workshop (continue) Use ROWID for Updates ROWIDs are unique row identifier The ROWID represents the physical address of the row in the database, but are subject to change, so don’t store them When you have to select rows, then subsequently update them, retrieve the ROWID also and use that to identify the row to update Rowid_test.sql Workshop Workshop (continue) Short-Circuit Evaluations If left side of an OR expression is TRUE, the whole expression is TRUE TRUE OR FALSE = TRUE TRUE OR TRUE = TRUE If the left of an AND expression is FALSE, the whole expression is FALSE FALSE AND FALSE = FALSE FALSE AND TRUE = FALSE In these cases Oracle doesn’t evaluate the second half of the expression Place “least expensive” tests to the left of expressions short_circuit.sql Workshop Workshop (continue) Logic/Branch Ordering Evaluations of ELSIF and CASE statements stop once a match is found. Plac

文档评论(0)

qwd513620855 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档