今天发现select sysdate from dual ,它的执行计划与以前不一样,结果如下:
http://www.itpub.net/518843.html
SQL> select sysdate from dual ;
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1)
1 0 FAST DUAL (Cost=2 Card=1)
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
408 bytes sent via SQL*Net to client
431 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
发现逻辑读与物理读都是0,这个是10g的新特性。
http://julian.dyke.users.btopenworld.com/com/Optimisation/Operations/FastDual.html
FAST DUAL
Description
Provides a more efficient implementation for statements which select a single-row result from DUAL such as SYSDATE, USER or arithmetic calculations
Versions
This operation is implemented in the following versions
|
Example
This example was developed using Oracle 10.2.0.1 on Linux
This example does not require any table definitions
The statement
generates the following execution plan
If the "_fast_dual_enabled" parameter is set to FALSE (default TRUE) then the FAST DUAL operation is disabled. For example
Now the statement
generates the following execution plan