Re: Making type Datum be 8 bytes everywhere

Nazir Bilal Yavuz <byavuz81@gmail.com>

From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Date: 2025-07-24T11:58:47Z
Lists: pgsql-hackers
Hi,

Thank you for working on this!

On Wed, 23 Jul 2025 at 22:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I'm disinclined to put in a huge amount of effort looking for the
> worst case.  We established long ago that we weren't going to
> optimize for 32-bit anymore.  So as long as this doesn't completely
> tank performance on 32-bit, I'm satisfied.  I'd almost say that
> if standard pgbench doesn't notice the change, that's good enough.

I did a basic pgbench benchmark on a 32-bit build and there is no change.

$ pgbench -i -s 100 test
$ pgbench -c 16 -j 16 -b $type -T 150 test

TPS results are:

select-only:
    master:     215654
    patched:    215751

simple-update:
    master:     4454
    patched:    4446

tpcb-like:
    master:     4094
    patched:    4128


-- 
Regards,
Nazir Bilal Yavuz
Microsoft



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Avoid faulty alignment of Datums in build_sorted_items().

  2. Grab the low-hanging fruit from forcing USE_FLOAT8_BYVAL to true.

  3. Grab the low-hanging fruit from forcing sizeof(Datum) to 8.

  4. Make type Datum be 8 bytes wide everywhere.

  5. Mop-up for Datum conversion cleanups.