Re: Counting unique rows as an aggregate.

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: Counting unique rows as an aggregate.
Дата
Msg-id dcc563d10809291325o2a682636s95e4b8ac51ca02ae@mail.gmail.com
обсуждение исходный текст
Ответ на Counting unique rows as an aggregate.  (r_musta <zepolen@gmail.com>)
Список pgsql-general
On Mon, Sep 29, 2008 at 12:12 PM, r_musta <zepolen@gmail.com> wrote:
> However, this is starting to become too slow (as there are about 10 of
> these queries), and therefore I need to write an aggregate function
> which lets me do:
>
>>SELECT count_unique(make), count_unique(color) from table WHERE >criteria<;
>
> After reading about aggregate functions, this should be possible, as
> long as I can use a dictionary/hashmap type for the state<STYPE>
> argument.

This might be a nice fit for materialized views.  While they're not
built in, PostgreSQL's extensibility allows you to build them prettily
easily.

http://jonathangardner.net/tech/w/PostgreSQL/Materialized_Views

Jonathan Gardner's web page on it is fantastic.

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: database question
Следующее
От: "postgres Emanuel CALVO FRANCO"
Дата:
Сообщение: Re: [HACKERS] PostgreSQL future ideas