Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates
| От | Tom Lane |
|---|---|
| Тема | Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates |
| Дата | |
| Msg-id | 21134.1414505167@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates (Heikki Linnakangas <hlinnakangas@vmware.com>) |
| Ответы |
Re: [WIP Patch] Using 128-bit integers for sum, avg and
statistics aggregates
|
| Список | pgsql-hackers |
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> It wouldn't be too hard to just do:
> struct {
> int64 high_bits;
> uint64 low_bits;
> } pg_int128;
> and some macros for the + - etc. operators. It might be less work than
> trying to deal with the portability issues of a native C datatype for this.
-1. That's not that easy, especially for division, or if you want to
worry about overflow. The point of this patch IMO is to get some low
hanging fruit; coding our own int128 arithmetic doesn't sound like
"low hanging" to me.
Also, we've already got the configure infrastructure for detecting
whether a platform has working int64. It really shouldn't be much
work to transpose that to int128 (especially if we don't care about
printf support, which I think we don't).
regards, tom lane
В списке pgsql-hackers по дате отправления: