Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Understanding Oracle Explain Plan

Oracle Database Tips by Donald BurlesonAugust 26, 2015

Question:  I need some tips for understanding the Oracle explain plan.  I have been told that reading the Oracle explain plan will help me identify tuning opportunities, but the explain plan and how to use it are a mystery to me.

Answer:  In the most basic terms, the Oracle explain plan is a tool that can be used to get Oracle to tell you how it plans on executing a query.  Clearly, this makes the explain plan a valuable tool for tuning.

Once the Oracle explain plan reveals how it plans on executing the query in question, the environment can be adjusted to run the query faster.

The Oracle explain plan is a statement that returns execution plans for the requested SELECT, UPDATE, INSERT and DELETE statements.  The execution plan for any given statement shows the operations in sequence used by Oracle to run that statement.

Information returned by the Oracle explain plan includes:

  • the tables referenced in the statement
  • the ordering and method with which each table is accessed
  • for join operations, the join method for the tables involved
  • data operations such as filter or sort included in the statement.

In addition to the information listed above, the Oracle explain plan table will also contain information on:

  • optimization
  • partitioning
  • parallel execution

The explain plan information is written to an explain plan table.  It is important to note that the explain plan table must be created before running the explain plan statement.

Once the Oracle explain plan table has been created, suspect SQL statements can be evaulated and tuned accordingly.

It is also possible to derive an Oracle explain plan using the SQL*Plus autotrace function as shown here:

  2  FROM   emp e, dept d
  3  WHERE  e.deptno = d.deptno
  4  AND    e.ename  = 'SMITH';

The disadvantage of this method is that the statement has to complete its run in order to be evaluated.  If the statement is truly bad, this could involve a considerable amount of wasted time.

The preferred method would be the Oracle explain plan route.

The explain plan statement generates the execution plan for a query without executing the query itself, allowing the execution plan for poorly performing queries to be displayed without impacting the database. 

The following example shows how the explain plan statement is used to generate an execution plan:

2  SELECT *  
3  FROM   emp e, dept d  
4  WHERE  e.deptno = d.deptno  
5  AND    e.ename  = 'SMITH';


If multiple people are accessing the same Oracle explain plan table, or a history of the Oracle execution plans is to be saved, the statement_id clause of the Oracle explain plan statement should be used.  This associates a user specified identifier with each explain plan, which can be used when retrieving the data. 

The following example shows how the statement_id is set using the Oracle explain plan statement.

2  SELECT *  
3  FROM   emp e, dept d  
4  WHERE  e.deptno = d.deptno  
5  AND    e.ename  = 'SMITH'; Explained.

The goals of tuning the SQL statements returned by the Oracle explain plan are fairly simple:

  • Eliminate sub-optimal large-table full-table scans: Ensure that the fastest access path to the data is chosen.  The execution plan "FULL" is the key.
  • Use fastest table join method: The optimizer must choose intelligently between nested loops joins, hash joins and star transformation join methods and these are displayed in the execution plan.  
  • Ensure optimal table-joining order: SQL will run fastest when the first table joins deliver the smallest result set.

With Oracle 11g, SQL Plan Management evolves more fully.

Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.




Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster