Re: Improving avg performance for numeric

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Improving avg performance for numeric
Дата
Msg-id CAFj8pRDvpB4NJkUx+iTxVfMcxD3O9KxB6vYTAffh5kdicoDfEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Improving avg performance for numeric  (Hadi Moshayedi <hadi@moshayedi.net>)
Ответы Re: Improving avg performance for numeric  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Hello

I am testing your code, and It increase speed of sum about 24% faster
then original implementation.

But I am surprise of AVG speed - it should have same speed like sum in
new implementation, but it is 2x slower, than sum - what signalize
some strange and there is used wrong transition function

I am sending fixed version

postgres=# create table bubu(a int, b float, c numeric);
CREATE TABLE
postgres=# insert into bubu select i, i+1, i+1.122 from
generate_series(1,1000000) g(i);
INSERT 0 1000000

After fixing a speed of sum and avg for numeric is similar

postgres=# select avg(c) from bubu;
         avg
---------------------
 500001.622000000000
(1 row)

Time: 228.483 ms
postgres=# select sum(c) from bubu;
       sum
------------------
 500001622000.000
(1 row)

Time: 222.791 ms

Regards

Pavel





2013/7/8 Hadi Moshayedi <hadi@moshayedi.net>:
> I am attaching the updated the patch, which also fixes a bug which
> caused one of the regression tests failed.
>
> I'll subscribe this patch to the commitfest in the next hour.
>
> Can you please review the patch?
>
> Thanks,
>    -- Hadi

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Review: Patch to compute Max LSN of Data Pages
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: sepgsql and materialized views