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

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, 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:04:34
Message-ID: 544FB082.5090102@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/28/2014 04:01 PM, Heikki Linnakangas wrote:
> Moving on to other issues, isn't 128 bits too small to store the squares
> of the processed numbers? That could overflow..

Yeah, which is why stddev_*(int8) and var_*(int8) still have to use
Numeric in the aggregate state. For the int2 and int4 versions it is
fine to use __int128_t.

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2014-10-28 15:16:19 Re: Directory/File Access Permissions for COPY and Generic File Access Functions
Previous Message Heikki Linnakangas 2014-10-28 15:01:13 Re: [WIP Patch] Using 128-bit integers for sum, avg and statistics aggregates