|
原帖由 Yong Huang 于 2008-12-10 10:58 发表 ![]()
You need to have a habit of telling us where you find the example if it was not written by you. It's a way to honor their copyright and also exempt you from responsibility for errors.
When you compare performance in this case, elapsed time is not as important as, for instance, buffer_gets per execution. Find these values in v$sql or, if 10g, preferably v$sqlstats. Whether the SQL actually does a bulk collect behind the scenes can be detected by rows_processed / executions, as well as buffer_gets / executions.
Yong Huang
Yong Huang,你说的根据rows_processed / executions,看不出的,我试了一下,还是跑前面我贴出来的脚本.结果如下:
SQL> select sql_text, rows_processed,executions from v$sqlstats where sql_text like '%where rownum < 100000%';
SQL_TEXT ROWS_PROCESSED EXECUTIONS
-------------------------------------------------------------------------------- -------------- ----------
declare type tnt_ic01 is table of PDATA_CELL_1%rowtype; nt_ic01 t 1 1
declare type tnt_ic01 is table of PDATA_CELL_1%rowtype; nt_ic01 tnt 1 1
SQL>
2个过程(一个用bulk ,一个不用),看不出区别. |
|