Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL
Date
Msg-id 3947.1300729241@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL  (Greg Stark <gsstark@mit.edu>)
Responses Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> So it's a clever hack that we used to allow the partial indexes to be
> used. It relied on the implicit assumption that min(x) and max(x)
> where the only values of x where NULL were both NULL.

> It would be nice if we were clever enough to support *any* strict
> aggregate using partial indexes on WHERE NOT NULL since they'll all
> have that property.

Huh?  The point of the min/max optimization is to not scan the whole
index but just fetch the endpoint value.  For general aggregates, you
have to scan the table anyway.  If an index is useful for that, it'll
get picked up in the normal planning process.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL
Next
From: Bernd Helmle
Date:
Subject: psql \dt and table size