Re: MAX/MIN optimization via rewrite (plus query rewrites

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: MAX/MIN optimization via rewrite (plus query rewrites
Дата
Msg-id 20041111140753.GB16640@wolff.to
обсуждение исходный текст
Ответ на Re: MAX/MIN optimization via rewrite (plus query rewrites  ("Jim C. Nasby" <decibel@decibel.org>)
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: MAX/MIN optimization via rewrite (plus query rewrites generally)
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: multiline CSV fields