Re: Create TOAST table only if AM needs - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Create TOAST table only if AM needs
Date
Msg-id 20190517183421.3k7rbltnv7g7u6nj@alap3.anarazel.de
Whole thread Raw
In response to Create TOAST table only if AM needs  (Ashwin Agrawal <aagrawal@pivotal.io>)
Responses Re: Create TOAST table only if AM needs  (Robert Haas <robertmhaas@gmail.com>)
Re: Create TOAST table only if AM needs  (Ashwin Agrawal <aagrawal@pivotal.io>)
List pgsql-hackers
Hi,

On 2019-05-17 11:26:29 -0700, Ashwin Agrawal wrote:
> Currently TOAST table is always created (if needed based on data type
> properties) independent of table AM. How toasting is handled seems
> should be AM responsibility. Generic code shouldn't force the use of
> the separate table for the same. Like for Zedstore we store toasted
> chunks in separate blocks but within the table file itself and don't
> need separate toast table. Some other AM may implement the
> functionality differently. So, similar to relation forks, usage of
> toast table should be optional and left to AM to handle.

Yea, Robert is also working on this. In fact, we were literally chatting
about it a few minutes ago. He'll probably chime in too.


> +static inline bool
> +table_uses_toast_table(Relation relation)
> +{
> +    return relation->rd_tableam->uses_toast_table;
> +}

Don't think this is sufficient - imo it needs to be a callback to look
at the columns etc.


My inclination is that it's too late for 12 to do anything about
this. There are many known limitations, and we'll discover many more, of
the current tableam interface. If we try to fix them for 12, we'll never
get anywhere.  It'll take a while to iron out all those wrinkles...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Ashwin Agrawal
Date:
Subject: Create TOAST table only if AM needs
Next
From: Tom Lane
Date:
Subject: Re: pgindent run next week?