首页 > Linux操作系统 > Linux操作系统 > FAST DUAL执行计划?
今天发现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
Provides a more efficient implementation for statements which select a single-row result from DUAL such as SYSDATE, USER or arithmetic calculations
This operation is implemented in the following versions
|
This example was developed using Oracle 10.2.0.1 on Linux
This example does not require any table definitions
The statement
SELECT SYSDATE FROM dual;
generates the following execution plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 FAST DUAL
If the "_fast_dual_enabled" parameter is set to FALSE (default TRUE) then the FAST DUAL operation is disabled. For example
ALTER SESSION SET "_fast_dual_enabled" = FALSE;
Now the statement
SELECT SYSDATE FROM dual;
generates the following execution plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 TABLE ACCESS (FULL) OF 'DUAL'
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-82829/ ,如需转载,请注明出处,否则将追究法律责任。