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

From Robert Haas
Subject Re: Using 128-bit integers for sum, avg and statistics aggregates
Date
Msg-id CA+TgmoZJWHCqCtrEXvAo6_cVRTZMpWiqAC0eUv4MOtS1=Bb4ag@mail.gmail.com
Whole thread Raw
In response to Re: Using 128-bit integers for sum, avg and statistics aggregates  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Using 128-bit integers for sum, avg and statistics aggregates
List pgsql-hackers
On Fri, Dec 26, 2014 at 7:57 AM, David Rowley <dgrowleyml@gmail.com> wrote:
> 1. Do we need to keep the 128 byte aggregate state size for machines without
> 128 bit ints? This has been reduced to 48 bytes in the patch, which is in
> favour code being compiled with a compiler which has 128 bit ints.  I kind
> of think that we need to keep the 128 byte estimates for compilers that
> don't support int128, but I'd like to hear any counter arguments.

I think you're referring to the estimated state size in pg_aggregate
here, and I'd say it's probably not a big deal one way or the other.
Presumably, at some point, 128-bit arithmetic will become common
enough that we'll want to change that estimate, but I don't know
whether we've reached that point or not.

> 2. References to int16 meaning 16 bytes. I'm really in two minds about this,
> it's quite nice to keep the natural flow, int4, int8, int16, but I can't
> help think that this will confuse someone one day. I think it'll be a long
> time before it confused anyone if we called it int128 instead, but I'm not
> that excited about seeing it renamed either. I'd like to hear what others
> have to say... Is there a chance that some sql standard in the distant
> future will have HUGEINT and we might regret not getting the internal names
> nailed down?

Yeah, I think using int16 to mean 16-bytes will be confusing to
someone almost immediately.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Additional role attributes && superuser review
Next
From: Robert Haas
Date:
Subject: Re: orangutan seizes up during isolation-check