Re: Surprising benchmark count(1) vs. count(*)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Surprising benchmark count(1) vs. count(*)
Дата
Msg-id 15291.1568928995@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Surprising benchmark count(1) vs. count(*)  (Adam Brusselback <adambrusselback@gmail.com>)
Список pgsql-performance
Adam Brusselback <adambrusselback@gmail.com> writes:
> It would be nice if Postgres optimized this case though because it is
> really really common from what i've seen.

Since the introduction of the "planner support function" infrastructure,
it'd be possible to do this without it being a completely ugly kluge:
we could put the logic for it into a planner support function attached
to count(any).  Currently planner support functions are only called for
regular functions, but we could certainly envision adding the ability to
do it for aggregates (and window functions too, why not).

I'm not particularly planning to do that myself, but if someone else
wants to write a patch, have at it.

            regards, tom lane



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

Предыдущее
От: Luís Roberto Weck
Дата:
Сообщение: Re: Slow query on a one-tuple table
Следующее
От: Luís Roberto Weck
Дата:
Сообщение: Re: Slow query on a one-tuple table