USE EXPLAIN PLAN

OmarChina發表於2007-10-15
簡單的一點。[@more@]

SQL> explain plan for
2 select ename from scott.emp;

Explained.

@$ORACLE_HOME/rdbms/admin/utlxpls.sql

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 14 | 84 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| EMP | 14 | 84 | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------

8 rows selected.

SQL> select plan_table_output from table(dbms_xplan.display('plan_table',null,'serial'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 14 | 84 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| EMP | 14 | 84 | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------

8 rows selected.

SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9925929/viewspace-976712/,如需轉載,請註明出處,否則將追究法律責任。

相關文章