i have a table with columns A and B which are correlated in the following meaning:
A == 1 => B == 3
A == 2 => B == 0
A == 3 => B == 7
with => meaning implies with high probability. I want to query like this:
where A = 2 and B = 3 --very few rows should match
so i have created statistics on (A, B). however the query optimizer completely misestimates the rowcount by a factor of 10. any ideas why? the joint histogram should allow for a very precise estimate. btw: cardinality(A) = 10, cardinality(B) = 5