Which statement is true about the execution of the PROC1 procedure in this scenario?

Examine the following settings for a session:
PLSQL_CODE_TYPE = NATIVE
View the Exhibit and examine the PL/SQL code.
You compile the program with the following attributes:
SQL> ALTER PROCEDURE proc1 COMPILE PLSQL_OPTIMIZE_LEVEL = 1;
Which statement is true about the execution of the PROC1 procedure in this scenario?(Exhibit)

Examine the following settings for a session:
PLSQL_CODE_TYPE = NATIVE

View the Exhibit and examine the PL/SQL code.
You compile the program with the following attributes:

SQL> ALTER PROCEDURE proc1 COMPILE PLSQL_OPTIMIZE_LEVEL = 1;

Which statement is true about the execution of the PROC1 procedure in this scenario?

A.
The FUNC1 function would be called inline because PRAGMA INLINE forces a specific call to be inlined..

B.
The FUNC1 function would be inlined because the value set for the PLSQL_CODE_TYPE parameter is set to NATIVE.

C.
The FUNC1 function would be called inline irrespective of the value set for the PLSQL_OPTIMIZE_LEVEL parameter.

D.
The FUNC1 function would not be called inline because the value for the PLSQL_OPTIMIZE_LEVEL parameter is set to a lower value.



Leave a Reply 7

Your email address will not be published. Required fields are marked *


leo yu

leo yu

within my understanding, the pragma inline directive would force the function to be inline irrespective of the optimization level.
optimization level=0: no optimization
=1: can remove unnessary code
=2: can move source code
=3: automatic optimization technology applying including automatic inline

Arijit

Arijit

The reason it does not inline the subprogram, because PLSQL_OPTIMIZE_LEVEL parameter value is set to 1. When optimizer level is set to 1, it does not re-arrange the original source code order.

—————–please refer below for more details ————————
https://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams184.htm#REFRN10255

LSQL_OPTIMIZE_LEVEL specifies the optimization level that will be used to compile PL/SQL library units. The higher the setting of this parameter, the more effort the compiler makes to optimize PL/SQL library units.

Values:

0

Maintains the evaluation order and hence the pattern of side effects, exceptions, and package initializations of Oracle9i and earlier releases. Also removes the new semantic identity of BINARY_INTEGER and PLS_INTEGER and restores the earlier rules for the evaluation of integer expressions. Although code will run somewhat faster than it did in Oracle9i, use of level 0 will forfeit most of the performance gains of PL/SQL in Oracle Database 10g.

1

Applies a wide range of optimizations to PL/SQL programs including the elimination of unnecessary computations and exceptions, but generally does not move source code out of its original source order.

2

Applies a wide range of modern optimization techniques beyond those of level 1 including changes which may move source code relatively far from its original location.

3

Applies a wide range of optimization techniques beyond those of level 2, automatically including techniques not specifically requested.