ITPub博客

首页 > Linux操作系统 > Linux操作系统 > FAST DUAL执行计划?

FAST DUAL执行计划?

原创 Linux操作系统 作者:lfree 时间:2006-04-06 00:00:00 0 删除 编辑

今天发现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

10.1.0
10.2.0

Example

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博客 ” ,链接:http://blog.itpub.net/267265/viewspace-82829/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Ora-01000错误
请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2285
  • 访问量
    6025071