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 开发者_如何学Gobackground 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.
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.
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
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.
精彩评论