Re: iceberg queries

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: iceberg queries
Дата
Msg-id 20030204155013.GA4209@wolff.to
обсуждение исходный текст
Ответ на Re: iceberg queries  ("Wei Weng" <wweng@kencast.com>)
Список pgsql-sql
On Tue, Feb 04, 2003 at 09:08:56 -0500, Wei Weng <wweng@kencast.com> wrote:
> It is a query that looks like
> 
> SELECT target1, target2... targetn, SUN(t.qty)
> FROM Table t
> GROUP BY target1
> HAVING SUM(t.qty)>=10
> 
> You can replace SUM(t.qty)>=10 with other aggregate constraints.

There were some recent changes to allow groups to use hashes that may
help for queries like this. This can save a sort step or using an
index scan.

In theory you might be able to make some other speed ups by taking advantage
of properties of specific aggregate functions (in particular that several
common ones monotonicly increase or decrease as they are being calculated)
and if doing an index scan on the fields used for group you might be able to
skip a lot of rows. I expect that this situation would come up pretty rarely
though.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Wei Weng"
Дата:
Сообщение: Re: iceberg queries
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: pg_views