ITPub博客

首页 > Linux操作系统 > Linux操作系统 > dbms xplan 详解

dbms xplan 详解

原创 Linux操作系统 作者:season0891 时间:2011-07-16 15:12:09 0 删除 编辑

http://www.orafaq.com/wiki/DBMS_XPLAN

DBMS_XPLAN (DBMS Explain Plan) is a PL/SQL package used for formatting and displaying SQL query plans.

[edit] Examples

Statements:

explain plan for select * from t1 where num_col = '1';
select * from table(dbms_xplan.display);

Statements with sample output:

SQL> EXPLAIN PLAN FOR select * from dept where deptno = 40;
Explained.

SQL> set linesize 132
SQL> SELECT * FROM TABLE(dbms_xplan.display);

PLAN_TABLE_OUTPUT
---------------------------------------------------------------------------------------
Plan hash value: 2852011669
---------------------------------------------------------------------------------------
| Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |         |     1 |    20 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| DEPT    |     1 |    20 |     1   (0)| 00:00:01 |
|*  2 |   INDEX UNIQUE SCAN         | PK_DEPT |     1 |       |     0   (0)| 00:00:01 |
---------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("DEPTNO"=40)

14 rows selected.

[edit] Also see

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90618/viewspace-702369/,如需转载,请注明出处,否则将追究法律责任。

下一篇: ORACLE锁的管理
请登录后发表评论 登录
全部评论

注册时间:2008-06-10

  • 博文量
    791
  • 访问量
    1946606