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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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) |
| ||||
| 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 |