CREATING EXPLAIN PLAN FOR ORACLE SQL
The EXPLAIN PLAN statement displays execution plans chosen
by the Oracle optimizer for SELECT, UPDATE, INSERT, and
DELETE statements.
Run This Script To create Plan Table
$ORACLE_HOME/rdbms/admin/utlxplan.sql
Execute the SQL command like the following.
SQL> explain plan for select * from ultimus.cor_trans_gl_hist where year=2009 order by
branch_id;
Explained
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1485638787
--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2429K| 651M| | 365K
| 1 | SORT ORDER BY | | 2429K| 651M| 1807M| 365K
|* 2 | TABLE ACCESS FULL| COR_TRANS_GL_HIST | 2429K| 651M| | 218K
--------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter(TO_NUMBER("YEAR")=2009)
14 rows selected
----------------------------------------------------------------------------------------------
Comments
Post a Comment