When compiling objects (functions/procedures/packages) in Oracle, there are several options available to aid in debugging and performance
- PLSQL_OPTIMIZE_LEVEL – introduced in Oracle 10g, this system/session option specifies the optimizations Oracle should use to compile program units. These include improvements such as inlining and replacing cursor for loops with more efficient bulk operations such as FORALL. For more information, see http://docs.oracle.com/cd/E14072_01/server.112/e10820/initparams189.htm
- Compile with DEBUG option. This option tells Oracle to generate instrumentation code for the PL/SQL debugger. Specifying DEBUG has the same effect as PLSQL_OPTIMIZE_LEVEL=1 according to the 11gR2 docs here
To view the optimization level, debug flags and other settings applying to individual program units (within the current schema), you can query USER_PLSQL_OBJECT_SETTINGS
select * from user_plsql_object_settings