Re: Improving count(*)

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas DCP SD
Тема Re: Improving count(*)
Дата
Msg-id E1539E0ED7043848906A8FF995BDA5799A53CF@m0143.s-mxs.net
обсуждение исходный текст
Ответ на Improving count(*)  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: Improving count(*)  (Tino Wildenhain <tino@wildenhain.de>)
Список pgsql-hackers
> > Since that costs, I guess I would make it optional and combine it
with
> > materialized views that are automatically used at runtime, and can
at
> > the same time answer other aggregates or aggregates for groups.
> > create materialized view xx_agg enable query rewrite as select
> > count(*), sum (col1) from xx [group by col2];
> >
>
> I wonder how many times you really need a count(*) w/o where clause.
> If I understand you correctly you are trying to optimize just this one
case?

I guess you have not read to the end. A materialized view with a group
by
as indicated in the example is able to answer all sorts of queries
with or without where clauses ( e.g. ... where col2 = 'x').

Andreas


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

Предыдущее
От: "Zeugswetter Andreas DCP SD"
Дата:
Сообщение: Re: MERGE vs REPLACE
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: Improving count(*)