Monday, 30 June 2008

Fast Dual in Oracle

Oracle 10g introduces FAST DUAL. Now, when the the DUAL table is accessed, no logical I/O is performed which improves performance.

We can demonstrate this by generating a million rows using the DUAL table.
set timi on
set autot trace stat
SELECT rownum FROM dual CONNECT BY LEVEL <= 1000000;
1000000 rows selected.
Elapsed: 00:00:08.07
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
14380219 bytes sent via SQL*Net to client
733838 bytes received via SQL*Net from client
66668 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1000000 rows processed
The statistics trace shows that 1 million rows have been processed without any logical I/O being performed.

No comments: