Re: Avg performance for int8/numeric

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Avg performance for int8/numeric
Дата
Msg-id 1164341365.23622.191.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Avg performance for int8/numeric  (Mark Kirkwood <markir@paradise.net.nz>)
Ответы Re: Avg performance for int8/numeric
Re: Avg performance for int8/numeric
Re: Avg performance for int8/numeric
Список pgsql-patches
On Fri, 2006-11-24 at 11:08 +1300, Mark Kirkwood wrote:
> - Modifies do_numeric_accum to have an extra bool parameter and does not
> calc sumX2 when it is false.

I think it would be clearer to reorganize this function slightly, and
have only a single branch on "useSumX2". On first glance it isn't
obviously that transdatums[2] is defined (but unchanged) when useSumX2
is false.

> Performance gain is approx 33%

Nice.

> (it is still slower than doing sum/count - possibly due to the
> construct/deconstruct overhead of the numeric transition array).

This would indeed be worth profiling. If it turns out that array
overhead is significant, I wonder if we could use a composite type for
the transition variable instead. That might also make it easier to
represent the "N" value as an int8 rather than a numeric.

-Neil



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

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Avg performance for int8/numeric
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Avg performance for int8/numeric