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

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Arthur Silva <arthurprs(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates
Date: 2014-10-28 15:01:13
Message-ID: 544FAFB9.5020106@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2014-10-28 15:04:34 Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates
Previous Message Robert Haas 2014-10-28 14:57:44 Re: alter user/role CURRENT_USER