ITPub博客

首页 > 数据库 > Oracle > subprogram inlining in 11g

subprogram inlining in 11g

原创 Oracle 作者:abstractcyj 时间:2014-09-01 17:11:19 0 删除 编辑

点击(此处)折叠或打开

  1. DECLARE
  2.   v_n NUMBER;

  3.   FUNCTION f_test RETURN NUMBER IS
  4.   BEGIN
  5.     RETURN 0;
  6.   END f_test;
  7. BEGIN
  8.   PRAGMA inline(f_test, \'YES\');
  9.   v_n := f_test;

  10.   dbms_output.put_line(v_n);
  11. END;
To summarise, therefore, the gains from inlining will usually be marginal except under very specific circumstances where the executable section of the subprogram is very quick (i.e. similar to the time it takes to call the subprogram). That said, for packages with large numbers of subprograms, the gains might start to accumulate. For some applications, this will be critical. At the very least, developers can no longer use performance degradation as a reason not to modularise (not that performance was ever a good reason not to modularise of course). We can write well-structured, modular programs and have the PL/SQL optimiser take care of the performance.

摘自:
http://www.oracle-developer.net/display.php?id=502


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

请登录后发表评论 登录
全部评论
曾从事java方向开发多年。近年已经转入数据库方向。主要擅长SQL优化,Oracle数据库问题诊断,Oracle备份与恢复等。服务于医药物流,医院等行业

注册时间:2010-01-26

  • 博文量
    602
  • 访问量
    1091611