投入多少,收获多少;投入多深,领悟多深。太阳底下没有新鲜事,排列组合就是创新。每天多做一点点,就是进步的开始,每天进步一点点,就是成功的开始,每天创新一点点,就是领先的开始。

Named vs Anonymous Pl/sql Blocks testing

上一篇 / 下一篇  2008-04-20 11:56:30 / 个人分类:ORACLE

1
begin
for i in 1..1000000
loop
begin select object_id into :a from test1 where rownum<2; end;
end loop;
end;
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1    145.03     157.67          0    4000238          0           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2    145.03     157.67          0    4000238          0           1
2
begin
for i in 1..1000000
loop
select object_id into :a from test1 where rownum<2;
end loop;
end;
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1    144.89     159.03          0    4000238          0           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2    144.89     159.03          0    4000238          0           1

3
BEGIN a; END;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.03       0.03          0         51          0           0
Execute      1     79.24      91.40          0          0          0           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2     79.27      91.44          0         51          0           1
/*create procedure a */
create or replace procedure a
is
i number ;
a number ;
begin
for i in 1..1000000 loop
select object_id into a from test1 where rownum<2;
end loop;
end;
/
 
 
从中可以看出在完成同样工作的情况下,Anonymous Pl/sql Blocks 性能和Named性能相差很多

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-09-07  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 4768
  • 日志数: 154
  • 建立时间: 2007-12-06
  • 更新时间: 2008-08-29

RSS订阅

Open Toolbar