 |
|
Oracle Tips by Burleson |
OCP Instructors Guide for
Oracle DBA Certification
Chapter 7 - Tuning and Performance
Using Explain Plan to
Determine Access Paths
You add one of the two phrases below to the beginning of the
statement to notify Oracle to update the plan_table with rows
describing the statement’s access path:
The second statement can be used to
differentiate statements in the PLAN_TABLE if it contains rows from
multiple EXPLAIN PLAN statements.
The EXPLAIN PLAN specification tells the
database to insert rows into the plan_table that describe the
statement’s access path. The query itself is not actually executed.
The following query can be used to display the contents of the
plan_table:
SELECT LPAD(' ',2*(LEVEL-1))||operation||'
'||options||' '||object_name||
' '||DECODE(id, 0, 'Cost = '||position) "Query Plan"
FROM foot.plan_table
START WITH id = 0
CONNECT BY PRIOR id = parent_id
The output below is an example of an EXPLAIN
PLAN "dump" using the above query:
61844 SELECT STATEMENT Cost = 61844
The above text is
an excerpt from:
OCP Instructors Guide for Oracle DBA Certification
A Study Guide to Advanced Oracle Certified Professional Database
Administration Techniques
ISBN 0-9744355-3-8
by Christopher T. Foot
http://www.rampant-books.com/book_2003_2_OCP_print.htm
|
Download your Oracle scripts now:
www.oracle-script.com
The
definitive Oracle Script collection for every Oracle professional DBA
|
|