A query has a join condition and one of the columns in the join is highly skewed with a single value .
Can anybody suggest how can we tune this type of joins.
Thanks in Advance
a typical solution would duplicate the query, the first with a condition "WHERE col = skewed_value" and the other "WHERE col <> skewed_value" and UNION ALL both selects.
Of course the optimizer needs statistics on the join columns.
Try first with stats on the column. The extremely skewed values can be dealt with by the optimizer by creating alternate plans. If that does not work, then follow Dieters advice.
Hint: if you have a significant number of these you are going to love TD14.10! Stay tuned...
Thanks for the reply. I tried with the above union all . the cost is somewhat reduced. but the problem is in the query i have 2 INNER JOINS with this type of skewed column on single side.