Re: Direct TOAST v2, faster, smaller and no migration needed - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Direct TOAST v2, faster, smaller and no migration needed
Date
Msg-id CAMT0RQToBWs4h2S2FzdfES+GOYgHRWbeG=AxtnbRd6jDYJHHPQ@mail.gmail.com
Whole thread
In response to Re: Direct TOAST v2, faster, smaller and no migration needed  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Sep 30, 2026 at 4:56 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> Yes, we've relied on the concept of TOAST tuple "identity" heavily for
> 20-ish years.

I will investigate an option to include more resiliency data,
including chunk numbers, in the larger TOAST chunks. They probably
would be redundant in single-chunk toast

I will also investigate adding a back-pointer to the original tuple,
which can be handy in some repacking scenarios.

> You could introduce a new behavior based on tids as an opt-in, I
> guess, leaving the default 4-bytes be, giving access to tid-based
> access tables for newly-created TOAST tables.

It was already optional and dynamic ALTER TABLE ... WITH (toast_flavour=direct)

It is already implemented for both 4- and 8-byte-oid toast

The latest discussion made me realise that I should also keep the
table structure as the classic/plain toast with just three fields
unless direct toast is requested so that the VACUUMing properties stay
the same .

The extra fields will only be added when you set the direct toast
option, after that, direct vacuuming of toast will be disabled.

--
Hannu



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Fix apply worker crash when subscriber table has only a deferrable primary key
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: [PATCH] Add a check_hook for output_plugin_libraries