Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates
Date
Msg-id 544FAFB9.5020106@vmware.com
Whole thread Raw
In response to Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates  (Andreas Karlsson <andreas@proxel.se>)
Responses Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates
List pgsql-hackers
On 10/28/2014 04:47 PM, Andreas Karlsson wrote:
> On 10/28/2014 03:40 PM, Heikki Linnakangas wrote:
>> The patch doesn't do division with the 128-bit integers. It only does
>> addition and multiplication. Those are pretty straightforward to implement.
>
> The patch uses division when converting from __int128_t to Numeric.

Oh, I see. Hmph, looks like I'm losing an argument..

Moving on to other issues, isn't 128 bits too small to store the squares 
of the processed numbers? That could overflow..

- Heikki




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: alter user/role CURRENT_USER
Next
From: Andreas Karlsson
Date:
Subject: Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates