Re: MAX/MIN optimization via rewrite (plus query rewrites - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: MAX/MIN optimization via rewrite (plus query rewrites
Date
Msg-id 20041111140753.GB16640@wolff.to
Whole thread Raw
In response to Re: MAX/MIN optimization via rewrite (plus query rewrites  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-hackers
On Thu, Nov 11, 2004 at 01:18:05 -0600, "Jim C. Nasby" <decibel@decibel.org> wrote:
> Certainly handling only one case is better than none. I just wanted to
> bring up the multiple aggregate scenario. Also, consider that
> 
> SELECT min(a), max(a), min(b), max(c) FROM table
> 
> could be optimized as well (into 4 index scans, assuming a, b, and c all
> had indexes).
> 
> I don't think any other aggregates are candidates for optimization right
> now, though I guess I could be wrong.

Remember that max and min are a number of aggregates, as each datatype
which have max and min functions have different ones from those used
by other datatypes.
I think someone added boolean aggregates for and and or in version 8.
If so, those can also use indexes in the same way.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites generally)
Next
From: Andrew Dunstan
Date:
Subject: Re: multiline CSV fields