Re: Support for 8-byte TOAST values, round two

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Hannu Krosing <hannuk(at)google(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support for 8-byte TOAST values, round two
Date: 2026-07-31 11:10:14
Message-ID: CAEze2Wjqkj1OGoj-K7bLLiG9UHs6bPMGuod3Aot6KZeUHwuzAA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 31 Jul 2026 at 12:58, Hannu Krosing <hannuk(at)google(dot)com> wrote:
>
> I ran a quick test and at least on x64 this is the case indeed:
>
> hannuk=# create table oid_vs_bigint(id oid primary key, int8 bigint unique);
> CREATE TABLE
> hannuk=# insert into oid_vs_bigint select i, i from
> generate_series(1,100000) g(i);
> INSERT 0 100000
> hannuk=# select indexrelid::regclass, pg_relation_size(indexrelid)
> from pg_index where indrelid = 'oid_vs_bigint'::regclass;
> indexrelid │ pg_relation_size
> ────────────────────────┼──────────────────
> oid_vs_bigint_pkey │ 2260992
> oid_vs_bigint_int8_key │ 2260992
> (2 rows)
>
> So, it's not slower because of size, but it's not faster either.

This test is not representative of real toast indexes, because it
skips the chunk number column. The addition of the chunk number column
will impact the size of the index, because now the index items are 16B
for OID vs 24B for OID8, for 20B and 28B page data usage respectively
after taking the 4-byte line pointer into account. Back of the
envelope calculations indicate this means the OID8 index will be about
40% larger.

Kind regards,

Matthias van de Meent.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vladlen Popolitov 2026-07-31 11:13:23 Re: [PATCH v1] add SQL type INT16 based on int128
Previous Message Hannu Krosing 2026-07-31 10:58:27 Re: Support for 8-byte TOAST values, round two