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.
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2009-02-27 23:30:29|
|Subject: pgsql: Temporarily (I hope) disable flattening of IN/EXISTS sublinks |
|Previous:||From: Jaime Casanova||Date: 2009-02-27 22:59:05|
|Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1530)|