EXPLAIN PLAN :: Demystification - Part 1

In TOAD simply write your query, then hit Ctrl-E to display your explain plan. If you see a permissions window popup regarding access to the PLAN_TABLE, then coordinate with DBA's to obtain the appropriate grants. Generally speaking low cost means better performance. Fewer outer joins and full table scans, generally means better performance. Remember also, that under your TOAD options, your Plan Table should be defined as PLAN_TABLE and the explain identifier is your workstation id.

In SQLPLUS you will need to run a statement like the following :

explain plan for your-precious-sql-statement;

Example ::

explain plan for
select *
from some.table
  where rec_id = 3227;

Followed by the following to generate a formatted explain plan. This will work at the unix level as well as windows :

select * from table(dbms_xplan.display);

Note: Originally sourced from :

http://www.adp-gmbh.ch/