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性能相差很多
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7364032/viewspace-245930/
,如需转载,请注明出处,否则将追究法律责任。