Re: [PATCH] Negative Transition Aggregate Functions (WIP)
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [PATCH] Negative Transition Aggregate Functions (WIP) |
| Дата | |
| Msg-id | 32025.1389898740@sss.pgh.pa.us обсуждение |
| Ответ на | Re: [PATCH] Negative Transition Aggregate Functions (WIP) (Heikki Linnakangas <hlinnakangas@vmware.com>) |
| Ответы |
Re: [PATCH] Negative Transition Aggregate Functions (WIP)
|
| Список | pgsql-hackers |
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> I propose that we reimplement sum(bigint) in a more efficient way: For
> the internal state, let's use an int8 and a numeric overflow field. The
> transition function adds to the int8 variable, and checks for overflow.
> On overflow, increment the numeric field by one. In the final function,
> multiply the numeric by 2^64, and add the residual int8 value.
It'd probably be sufficient to handle it as two int64 fields (handmade
128-bit arithmetic, or maybe even not so handmade if that ever gets
reasonably common among C compilers). You're assuming the final output
is still numeric, right?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера