RFC: multi TOAST-tables support - Mailing list pgsql-hackers

From Nikita Malakhov
Subject RFC: multi TOAST-tables support
Date
Msg-id CAN-LCVO+Vi+7nWYgOnkhApkzJob4075_V0QYS7_DwAxZJPMBJw@mail.gmail.com
Whole thread Raw
List 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.


Thanks in advance!

--
Regards,
Nikita Malakhov
Postgres Professional 

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: [Proposal] Add foreign-server health checks infrastructure
Next
From: Peter Smith
Date:
Subject: Re: Improve errhint for ALTER SUBSCRIPTION ADD/DROP PUBLICATION