cardinality/rows column in the explain plan

  • From: ryan_gaffuri@xxxxxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Tue, 24 Oct 2006 15:21:14 +0000

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 |
-----------------------------------------------------------------------------------------------------------------

Other related posts: