Home > Ask the Oracle Experts > Database Design and Architecture Questions & Answers > Reading an execution plan
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Reading an execution plan

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 29 July 2004
How should I read an execution plan? And which of the TKPROF or EXPLAIN PLAN would give me more realistic details regarding how a SQL query is executed. How do you read the output displayed by the DBMS_XPLAN?

>
EXPERT RESPONSE

TKPROF, EXPLAIN PLAN, and DBMS_XPLAN all display essentially the same information. DBMS_XPLAN does have some nice additional information and it is a good package to use. The big benefit of TKPROF is that you can trace your session and generate Explain Plans of all your session's SQL statements, rather then generating them one by one.

To read the output, I go down and right until I can't go down and right any more. Then cascade back up the tree. For instance:

SELECT STATEMENT 
  SORT GROUP BY 
    HASH JOIN   
      TABLE ACCESS FULL| DEPT |  
      TABLE ACCESS FULL| EMP  |   
In the example above, going down and right leads us to a Full Table Access fo the DEPT table. On that same level, I see another Full Table Scan of the EMP table. Both of these actions are performed. Going back up the tree (or to the left, the tree is on its side), I perform a HASH JOIN of these two tables. I then Sort them and the results are passed to the SELECT statement.

The following Chapter in the Performance Tuning Guide give much more information: http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10752/ex_plan.htm#19259

I'd also read other chapters in that document that pertain to tuning.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Database Design and Architecture
Should we worry about Oracle memory leaks on Windows?
How to disable Oracle constraints and triggers during an import in 10g
How to delete a partition on the F: drive with Oracle on Windows
What could be causing an SQL count 0 with a successful Oracle import?
What is a staging table, and how is the staging concept used in Oracle?
Tips for how to size an Oracle server
Oracle error 942 when exporting a schema
Do DDL statements roll back, and why?
Increasing Oracle storage capacity by moving to a new storage with minimum downtime
Using Undo Tablespaces vs. rollback segments in Oracle 9i, 10g

Oracle database design
Oracle database in the cloud floated at Harvard lab
Oracle OpenWorld 2008 Special Report
Weighing remote database administration pros and cons takes care
Oracle Database 11g makes waves at Burlington Coat Factory
How to create a database link in Oracle
Data modeling tools no substitute for hard work
How do I do that in Oracle?
The Oracle Database user's guide to Oracle OpenWorld 2007
Oracle OpenWorld 2007 Special Report
How many redo log files?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
extent  (SearchOracle.com)
field  (SearchOracle.com)
flexfield  (SearchOracle.com)
foreign key  (SearchOracle.com)
quad tree  (SearchOracle.com)
record  (SearchOracle.com)
row  (SearchOracle.com)
splay tree  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2003 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts