Tom Lane wrote:
>
> (2) The statistics that we have available are stats about a column.
> Not stats about a column given the predicate of some index. So there's
> no gain in our statistical knowledge either.
If we added just count of NULLs we would cover for the NOT NULL case
> Partial indexes might be a component of a solution, but they are
> very far from being a solution all by themselves.
>
> regards, tom lane
>
> PS: a quick glance at gram.y shows that we don't actually accept
> partial-index predicates in CREATE INDEX, so Andreas was right that
> the feature got ripped out at some point. I have no idea how much
> work might be required to re-enable it... but I'll bet it's not
> trivial.
That's why I suggested getting just the simplest case (NOT NULL)
working first.
The more general approach would of course be to gather stats by index.
--------------
Hannu