lunar@TSMISC02> drop table t;
Table dropped.
Elapsed: 00:00:00.03
lunar@TSMISC02> create table t ( x int );
Table created.
Elapsed: 00:00:00.00
lunar@TSMISC02> create or replace procedure proc1
2 as
3 begin
4 for i in 1 .. 10000
5 loop
6 execute immediate
7 'insert into t values ( :x )' using i;
8 end loop;
end; 9
10 /
Procedure created.
Elapsed: 00:00:00.03
lunar@TSMISC02> create or replace procedure proc2
2 as
3 begin
4 for i in 1 .. 10000
5 loop
6 execute immediate
'insert into t values ( '||i||')';
7 8 end loop;
9 end;
10 /
Procedure created.
Elapsed: 00:00:00.01
lunar@TSMISC02> exec runstats_pkg.rs_start
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.04
lunar@TSMISC02> exec proc1
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.99
lunar@TSMISC02> exec runstats_pkg.rs_middle
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.05
lunar@TSMISC02> exec proc2
PL/SQL procedure successfully completed.
Elapsed: 00:00:05.56
lunar@TSMISC02> exec runstats_pkg.rs_stop(1000)
Run1 ran in 1184 hsecs
Run2 ran in 1171 hsecs
run 1 ran in 101.11% of the time
Name Run1 Run2 Diff
STAT...redo size 2,339,132 2,333,620 -5,512
LATCH.library cache pin 80,226 90,148 9,922
STAT...enqueue requests 50 10,021 9,971
STAT...enqueue releases 48 10,021 9,973
STAT...parse count (hard) 2 10,002 10,000
LATCH.enqueue hash chains 137 20,084 19,947
LATCH.enqueues 137 20,086 19,949
LATCH.library cache pin alloca 40,123 60,081 19,958
LATCH.row cache objects 144 40,068 39,924
LATCH.row cache enqueue latch 120 40,054 39,934
LATCH.child cursor hash table 18 70,014 69,996
LATCH.library cache 110,414 240,300 129,886
STAT...session pga memory 0 131,072 131,072
LATCH.shared pool 50,259 276,039 225,780
Run1 latches total versus runs -- difference and pct
Run1 Run2 Diff Pct
366,082 940,701 574,619 38.92%
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.04
lunar@TSMISC02>