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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Join cardinality and query tuning.

Re: Join cardinality and query tuning.

From: <ryan_gaffuri_at_comcast.net>
Date: Mon, 01 Nov 2004 20:50:35 +0000
Message-Id: <110120042050.10628.4186A19B0004AABF000029842200762194079D9A00000E09A1020E979D@comcast.net>


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-l
Received on Mon Nov 01 2004 - 14:46:10 CST

Original text of this message

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