Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Join cardinality and query tuning.
I read wolfgang's article a while ago. Does his formula take into account the distinctiveness of the join column? If your join columns are not unique, the cardinality value will be larger. Also, I believe that the cardinality value at the 'join' level is the estimated number of records viewed during the operation, not returned. Do you have histograms? without them, this is often not accurate.
you are probably getting the hash join becuase of bad column order in your index. your column order should be
(val,row_id)
if you flip it, you end up with the full scan or an index full scan and hash join. column that is joined should almost always(using almost even though I have never seen a case of the opposite...) come after the column that filters out rows in a table.
-- http://www.freelists.org/webpage/oracle-lReceived on Mon Nov 01 2004 - 14:46:10 CST
![]() |
![]() |