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

From Robert Haas
Subject Re: [HACKERS] Decimal64 and Decimal128
Date
Msg-id CA+TgmoaiGrr6zbYO9AxYfoRu4h=v+vEv1kbpcex2evdqiTNZJQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Decimal64 and Decimal128  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
On Mon, Jun 19, 2017 at 3:47 PM, Peter Geoghegan <pg@bowt.ie> wrote:
> On Mon, Jun 19, 2017 at 12:19 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> I don't have a specific use case in mind.  However, datumCopy() is
>> sure to be a lot faster when typByVal is true, and see also the
>> documentation changes in commit
>> 8472bf7a73487b0535c95e299773b882f7523463.
>
> Fair enough.
>
> I ask because at one time I informally benchmarked Postgres (using
> pgbench), where int4 (or maybe int8) primary keys were replaced with
> equivalent numeric primary keys. This was a SELECT benchmark. Anyway,
> the conclusion at the time was that it makes surprisingly little
> difference (I think it was ~5%), because cache misses dominate anyway,
> and the page layout doesn't really change (the fan-in didn't change
> *at all* either, at least for this one case, because of alignment
> considerations). I never published this result, because I didn't have
> time to test rigorously, and wasn't sure that there was sufficient
> interest.

People work pretty hard for a 5% performance improvement, so I
wouldn't dismiss that difference as nothing.  However, I think the
difference would probably be larger if you were using the values for
computations (e.g. sum, avg) rather than as PKs.

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



pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: [HACKERS] postgresql transactons not fully isolated
Next
From: Sergey Burladyan
Date:
Subject: Re: [HACKERS] Broken hint bits (freeze)