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
|
Список | 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 по дате отправления: