Re: Using 128-bit integers for sum, avg and statistics aggregates

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andreas Karlsson <andreas(at)proxel(dot)se>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using 128-bit integers for sum, avg and statistics aggregates
Date: 2015-01-02 21:22:08
Message-ID: 54A70C00.8070204@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/31/14, 8:13 AM, Andres Freund wrote:
> On 2015-01-01 03:00:50 +1300, David Rowley wrote:
>>>> 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.
>>>
>>>
>> hmm, I think it should be changed to int128 then. Pitty int4 was selected
>> as a name instead of int32 back in the day...
>
> Note that the C datatype has been int32/int64 for a while now, it's just
> the SQL datatype and the names of its support functions. Given that,
> afaiu, we're talking about the C datatype it seems pretty clear that it
> should be named int128.

Should we start down this road with SQL too, by creating int32, 64 and 128 (if needed?), and changing docs as needed?

Presumably that would be best as a separate patch...
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-01-02 21:41:26 Re: Using 128-bit integers for sum, avg and statistics aggregates
Previous Message Tom Lane 2015-01-02 20:45:59 Re: Transactions involving multiple postgres foreign servers