Wednesday, May 20, 2015

Find SQL Execution Plan


SQL> EXPLAIN PLAN FOR SELECT * FROM EMPLOYEES WHERE DEPARTMENT_ID=50;

Explained.

SQL> SELECT * FROM TABLE (DBMS_XPLAN.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1445457117

-------------------------------------------------------------------------------
| Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           | 18113 |  2352K|   126   (1)| 00:00:02 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES | 18113 |  2352K|   126   (1)| 00:00:02 |
-------------------------------------------------------------------------------

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

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------

   1 - filter("DEPARTMENT_ID"=50)

Note
-----
   - dynamic sampling used for this statement (level=2)

17 rows selected.

SQL>

No comments:

Post a Comment