Re: [HACKERS] Decimal64 and Decimal128 - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] Decimal64 and Decimal128
Date
Msg-id CAEepm=2-xj--UgWOALizfN3rYMiywhYkP3d24A5k6O4kfU-9_Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Decimal64 and Decimal128  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Decimal64 and Decimal128  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Sun, Jun 18, 2017 at 5:38 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Thu, Jun 15, 2017 at 10:27 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> 1.  They are fixed size, and DECFLOAT(9) [= 32 bit] and DECFLOAT(17)
>> [= 64 bit] could in theory be passed by value.  Of course we don't
>> have a way to make those pass-by-value and yet pass DECFLOAT(34) [=
>> 128 bit] by reference!  That is where I got stuck last time I was
>> interested in this subject, because that seems like the place where we
>> would stand to gain a bunch of performance, and yet the limited
>> technical factors seems to be very well baked into Postgres.
>
> I feel like these would logically just be different types, like int4
> and int8 are.  We don't have integer(9) and integer(18).

Hmm.  Perhaps format_type.c could render decfloat16 as decfloat(16)
and decfloat34 as decfloat(34), and gram.y could have a production
that selects the right one when you write DECFLOAT(x) and rejects
values of x other than 16 and 34.

-- 
Thomas Munro
http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Preliminary results for proposed new pgindent implementation
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Preliminary results for proposed new pgindent implementation