不使用bind vars的影响

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>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值