Named vs Anonymous Pl/sql Blocks testing
1
begin
for i in 1..1000000
loop
begin select object_id into :a from test1 where rownum<2; end;
end loop;
end;
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
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
------- ------ -------- ---------- ---------- ---------- ---------- ----------
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;
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
------- ------ -------- ---------- ---------- ---------- ---------- ----------
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;
/
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部落格 ” ,連結:http://blog.itpub.net/7364032/viewspace-245930/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Autonomous PL/SQL Blocks (151)SQLBloC
- Oracle vs PostgreSQL Develop(23) - PL(pg)sql(引數宣告)OracleSQLdev
- PL/SQLSQL
- sqlplus : set autot traceonly vs pl/sql developer : F5SQLDeveloper
- SQL&PL/SQL (轉)SQL
- PL/SQL 宣告SQL
- PL/SQL cursorSQL
- PL/SQL打包SQL
- PL/SQL DEVSQLdev
- Oracle PL/SQLOracleSQL
- 使用PL/Scope分析PL/SQL程式碼SQL
- PLSQL Language Reference-PL/SQL概覽-PL/SQL架構SQL架構
- [PL/SQL]10g PL/SQL學習筆記(一)SQL筆記
- [PL/SQL]10g PL/SQL學習筆記(二)SQL筆記
- [PL/SQL]10g PL/SQL學習筆記(三)SQL筆記
- Anonymous InformantORM
- PL/SQL 迴圈SQL
- PL/SQL 遊標SQL
- PL/SQL 運算子SQL
- PL/SQL 條件SQL
- pl/sql to_dateSQL
- PL/SQL 基礎SQL
- Oracle PL/SQL INDICESOracleSQL
- PL/SQl Developer使用SQLDeveloper
- pl/sql陣列SQL陣列
- pl/sql練習SQL
- oracle PL/SQL示例OracleSQL
- 淺談pl/sqlSQL
- PL/SQL 索引表SQL索引
- pl/sql 練習SQL
- [pl sql] where current ofSQL
- pl/sql功能特性SQL
- PL/SQL Developer 使用SQLDeveloper
- PL/SQL小結SQL
- steven's pl/sqlSQL
- PL/SQL入門SQL
- PL/SQL 設定SQL
- PLSQL Language Reference-PL/SQL概覽-PL/SQL的優點SQL