On Fri, 2009-02-27 at 13:25 -0500, Tom Lane wrote: > So apparently we need to rethink this, and derate the correlation effect > somehow when there are constraints on non-first columns. I'm not > entirely sure what the model ought to be. Thoughts?
This seems similar to the problem of estimating correlation for a GiST index (as I recall you mentioned before that we should be tracking correlation per-index rather than per-attribute). Unless we get significantly smarter about what "correlation" means, I think its only purpose is for very simple range scans. And, as you point out, a selective predicate on a non-first attribute means that it's not really a range scan. I don't see an easy solution to this other than just saying that a predicate on a second attribute is not a range scan at all, unless the predicate is not very selective. Regards, Jeff Davis -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers