Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> cardinality/rows column in the explain plan

cardinality/rows column in the explain plan

From: <ryan_gaffuri_at_comcast.net>
Date: Tue, 24 Oct 2006 15:21:14 +0000
Message-Id: <102420061521.11357.453E2F69000E8A5C00002C5D2200735446079D9A00000E09A1020E979D@comcast.net>


I am looking at an explain plan with set autotrace on.

Table C has 53,000 rows. When I query dba_tables.num_rows it states that there are 53,000 rows. How can I have 'rows' of 1634 on a full table scan? Shouldn't it be all the rows in the table since Oracle is doing a full table scan?

I get teh same number when I look at the cardinality column in the 'explain plan for'. I had though that Oracle got the rows for a full table scan from dba_tables.num_rows? I guess not.


| Id  | Operation                          | Name                  | Rows  | Bytes | Cost (%CPU)| Pstart| Pstop |
-----------------------------------------------------------------------------------------------------------------

| 0 | SELECT STATEMENT | | 1 | 60 | 31780 (1)| | |
| 1 | SORT AGGREGATE | | 1 | 60 | | | |
| 2 | TABLE ACCESS BY LOCAL INDEX ROWID| TABLE A | 1 | 22 | 4 (0)| | |
| 3 | NESTED LOOPS | | 2986 | 174K| 31780 (1)| | |
| 4 | HASH JOIN | | 9506 | 352K| 3176 (4)| | |
| 5 | TABLE ACCESS FULL | TABLE B | 211 | 3587 | 229 (6)| | |
| 6 | TABLE ACCESS FULL | TABLE C | 1634 | 34314 | 2947 (4)| | |
| 7 | PARTITION RANGE ITERATOR | | 1 | | 3 (0)| KEY | KEY |
| 8 | INDEX RANGE SCAN | TABLE_A_IDX01 | 1 | | 3 (0)| KEY | KEY |
-----------------------------------------------------------------------------------------------------------------
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Oct 24 2006 - 10:21:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US