-
DECLARE
-
v_n NUMBER;
-
-
FUNCTION f_test RETURN NUMBER IS
-
BEGIN
-
RETURN 0;
-
END f_test;
-
BEGIN
-
PRAGMA inline(f_test, \'YES\');
-
v_n := f_test;
-
-
dbms_output.put_line(v_n);
-
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/
,如需转载,请注明出处,否则将追究法律责任。