RFC: multi TOAST-tables support

From: Nikita Malakhov <hukutoc(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RFC: multi TOAST-tables support
Date: 2022-10-17 08:37:03
Message-ID: CAN-LCVO+Vi+7nWYgOnkhApkzJob4075_V0QYS7_DwAxZJPMBJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers!

Reference TOAST mechanics assumes that a relation has a single TOAST
relation for all it's
TOASTable columns. While working on Pluggable TOAST [1] we've found that
single TOAST
relation for a relation is a bit of a problem, because different Toasters
could have different
TOAST table structure. Even for regular TOAST mechanism is is very strict
limitation that limits
size of storable data for the table by total size of TOASTed data, so even
without Pluggable
TOAST this will be a great feature.

We've dealt with this a straightforward way - introduced the
Oid *rd_toasterids; /* OIDs of attribute toasters, if any */
Oid *rd_toastrelids; /* OIDs of toast relations corresponding to
toasters, if any */
in the RelationData structure, but it seems to be not the best solution.

Another way is to store Toaster OID and TOAST relation ID in attoptions,
which is less invasive,
and keep existing reltoastrelid field for default (reference) TOAST
mechanism. But here we
encounter new problem - when we assign another Toaster for the column we
have to keep
somewhere all the old TOAST tables IDs, which looks like a problem for the
attoptions.
Or maybe there is a better way to store TOAST relations ID for a column?

We'd like to get some feedback on how to implement this part.

[1] https://commitfest.postgresql.org/40/3490/

Thanks in advance!

--
Regards,
Nikita Malakhov
Postgres Professional
https://postgrespro.ru/

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2022-10-17 08:45:07 Re: Improve errhint for ALTER SUBSCRIPTION ADD/DROP PUBLICATION
Previous Message Kyotaro Horiguchi 2022-10-17 08:26:42 Re: [Proposal] Add foreign-server health checks infrastructure