[HACKERS] Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL

2011-03-21 Thread Greg Stark
On Tue, Mar 22, 2011 at 4:35 AM, Tom Lane wrote: > Reimplement planner's handling of MIN/MAX aggregate optimization (again). > I'm just curious, Why is this no longer an interesting special case? --- this is an interesting special case as of 9.1 -explain (costs off) - select min(unique2) from

[HACKERS] Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL

2011-03-21 Thread Greg Stark
On Mon, Mar 21, 2011 at 5:40 PM, Tom Lane wrote: > Greg Stark 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

[HACKERS] Re: Planner regression in 9.1: min(x) cannot use partial index with NOT NULL

2011-03-21 Thread Greg Stark
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 N