Hi Ajyush,
a NUSI on tablea.col1 will not be used for joins (unless you use a very restrictive WHERE condiition).
Did you check for missing stats (using DIAGNOSTIC HELPSTATS ON FOR SESSION)?
Redistributing might be the most reasonable way, otherwise the 15mio rows might have to be duplicated.
You could also try to rewrite the join to a correlated subquery using EXISTS, but i doubt it will change the plan.
Btw, the "col+0" trick doesn't work anymore (the optimizer is smarter since TD13), but "col*1" or "coalesce(col1,col1)" still works.
Dieter
↧