Benchmarking Oracle User Procedures/Functions
I'm thinking of a way on how to benchmark an Oracle procedure. My idea is this, put a logging function
on each part
of the procedure
you wish to benchmark. Store the t开发者_JS百科ime it entered that part. Then, create another app (using PHP) to compute the difference between each execution.
The PHP app is needed to make it as layman as possible.
This idea wont work though because it is too scattered and obstrusive. If I want to execute the function/procedure multiple times at the same time, the result will be wrong.
Algorithms are fine. Codes is better. The whole app is best. :)
Oracle introduced the DBMS_PROFILER package in 9i. It does pretty much exactly what you describe, only better. Find out more.
In 11g they introduced the hierarchical profiler, which does something similar but for the entire PL/SQL callstack, not just an individual program unit. Find out more.
精彩评论