Robe Elckers
Robe Elckers

Reputation: 977

What's the influence of compiling ORACLE packages with DEBUG

we compile all our Oracle Packages with the DEBUG option enabled. This is the default for our IDE (PLSQLDeveloper). So when we compile a package in the background the following is executed:

ALTER PACKAGE emp_mgmt
   COMPILE DEBUG PACKAGE;

I wonder if there are any performance consequences for this. The Oracle docs about ALTER PACKAGE do not mention anything about this.

Upvotes: 14

Views: 11374

Answers (3)

Gary Myers
Gary Myers

Reputation: 35401

There's a whole range of optimizations that the PL/SQL compiler can do.

Setting the mode to debug is equivalent to setting the optimizer level to 1 (disabling most of the optimizations)

So it could have a significant impact on performance.

Upvotes: 9

Paolog
Paolog

Reputation: 71

Compiling with the debug option definitely affects performance. A simple test that loops 50,000 times calculating a metaphone for example (lots of string tests, if then else ...) takes twice the time in debug mode.

Upvotes: 2

Tim
Tim

Reputation: 2831

Oracle provides a Debug API for IDE developers. In the case that a Package is compiled with the DEBUG option, it is possible to set breaktpoints with that API. If you compiled all packages with the DEBUG option, someone can set a breakpoint via that API to manipulate the system!

So I think it is more an security issue than a preformance problem to compile Packages in debug mode.

EDIT: SET_BREAKPOINT Function in the Oracle documentation

Upvotes: 4

Related Questions