Re: Decimal64 and Decimal128

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Feng Tian <ftian(at)vitessedata(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Decimal64 and Decimal128
Date: 2017-06-18 02:31:18
Message-ID: CA+TgmobTYjrZNQZtrpBpgAZ_RMXFkdZZrOMnWJhJ7SMcXXbxyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 17, 2017 at 3:50 PM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Sun, Jun 18, 2017 at 5:38 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Thu, Jun 15, 2017 at 10:27 PM, Thomas Munro
>> <thomas(dot)munro(at)enterprisedb(dot)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.

What would be the point of that?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-06-18 03:58:43 Re: Decimal64 and Decimal128
Previous Message Peter Eisentraut 2017-06-18 01:07:00 Re: outfuncs.c utility statement support