Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: 'begin end' blocks and pl/sql performance
Ryan,
Should be simple to test, no?
Create a procedure that executes in this fashion, to use as a 'baseline" (i.e. no nested blocks):
begin
for i in 1..10000000 loop null; end loop;
Then, execute a procedure that executes in this fashion (i.e. 10 nested blocks):
begin
for i in 1..10000000 loop begin begin begin begin begin begin begin begin begin begin null; end; end; end; end; end; end; end; end; end; end; end loop;
Then, bracket each execution of these (before and after, calculating and recording the deltas) with:
select s.value from v$mystat s, v$statname n where n.name = 'CPU used by this session' and s.statistic# = n.statistic#;
Do it a bunch of times, record the deltas, drop the highest and lowest readings, average the remainder of the readings, etc.
Also, you might also want to try adding more significant "payload" to the loop (rather than the NULL command), such as "SELECT DUMMY FROM DUAL" or something like that.
Please report back what you find?
Hope this helps...
-Tim
attached mail follows:
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Fri Jun 11 2004 - 10:25:56 CDT
- message/rfc822 attachment: _begin_end__blocks_and_pl_sql_performance
![]() |
![]() |