getting wrong cardinality causing a Nest Loop instead of Hash Join
529051Dec 16 2006 — edited Dec 17 2006Oracle version 9.2.0.6
Without the use_hash hint the optimizer chooses
Nested Loop
view card = 600000 <- really close
index range card = 1 <-- this is very wrong it is more like 1000000
The index being used is an compsite index of 3 columns. I am suppling the SQL the value of the lead column:
col = 12345a
The access predicate line for the index range scan line is:
tab1.col1='12345a' AND tab1.col2 = tab2.col2 AND tab1.col3 = tab2.col3
I have analyzed all table in question at 100% with cascade.
If I do
select count(1) from tab1 where col1='12345a'
the cardinality is right on as we have a histogram on that column as the data is skewed.
how can I help Oracle understand more rows will be returned from the index range scan?
Thanks