Unix Technical Forum

how to interpret dbms_xplan.display

This is a discussion on how to interpret dbms_xplan.display within the Oracle Database forums, part of the Database Server Software category; --> I am using dbms_xplan.display to generate explain on a 9.2 database(see below). Just wondering what is what is the ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-23-2008, 10:29 AM
Ed Wong
 
Posts: n/a
Default how to interpret dbms_xplan.display

I am using dbms_xplan.display to generate explain on a 9.2
database(see below). Just wondering what is what is the unit of the
last column "Cost" and "%CPU"? And why is the "Rows" show 12M where
an index is being used? Thanks.


SQL> explain plan for select * from seq where id = 1000000;
Explained.

SQL> select * from table(dbms_xplan.display);

--------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
Cost (%CPU)|
--------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 695 |
4 (25)|
| 1 | TABLE ACCESS BY INDEX ROWID| SEQ | 1 | 695 |
4 (25)|
|* 2 | INDEX UNIQUE SCAN | PK_SEQ | 12M| |
3 (34)|
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

2 - access("SEQ"."ID"=1000000)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-23-2008, 10:29 AM
srivenu
 
Posts: n/a
Default Re: how to interpret dbms_xplan.display

The cardinality of INDEX UNIQUE SCAN shows the full cardinality of the
table.
And the cardinality of TABLE ACCESS BY INDEX ROWID that follows it
shows as 1.

Whereas if you have an INDEX RANGE SCAN, the cardinality shows the
number of rows that would be returned. And the TABLE ACCESS BY INDEX
ROWID that follows it shows the same cardinality (provided there are
no additional predicates on the other table columns).

The cost is normally the number of I/O calls issued.
regards
Srivenu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com