How to display the explain plan of a query using dbms_xplan table funtion?
January 16th, 2006 By smnair
explain plan for select * from dual / select * from table (dbms_xplan.display) /

January 16th, 2006 By smnair
explain plan for select * from dual / select * from table (dbms_xplan.display) /
You must be logged in to post a comment.
January 16th, 2006 at 9:47 pm
I could see this as a more general point — “How to see the execution plan of a query” followed by a list of this technique, “set autotrace …”, SQL Trace, OEM etc. — but this is a little _too_ specific for my taste
February 8th, 2006 at 12:32 pm
A new feature of Oracle 10g Release 2 is that
is using DBMS_XPLAN now.
Quote from http://www.oracle.com/technology/oramag/oracle/05-sep/o55asktom.html
SQL> set autotrace traceonly explain SQL> select * 2 from emp, dept 3 where emp.deptno = dept.deptno 4 and emp.job = 'CLERK'; Execution Plan - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Plan hash value: 877088642 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | Id | Operation | Name | Rows | Bytes | Cost (%CPU) | Time | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 0 | SELECT STATEMENT | | 4 | 468 | 7 (15) | 00:00:01 | |* 1 | HASH JOIN | | 4 | 468 | 7 (15) | 00:00:01 | |* 2 | TABLE ACCESS FULL | EMP | 4 | 348 | 3 (0) | 00:00:01 | | 3 | TABLE ACCESS FULL | DEPT | 4 | 120 | 3 (0) | 00:00:01 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Predicate Information (identified by operation id): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - access("EMP"."DEPTNO"="DEPT"."DEPTNO") 2 - filter("EMP"."JOB"='CLERK') Note - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dynamic sampling used for this statement