Re: Create TOAST table only if AM needs

From: Andres Freund <andres(at)anarazel(dot)de>
To: Ashwin Agrawal <aagrawal(at)pivotal(dot)io>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Create TOAST table only if AM needs
Date: 2019-05-17 18:34:21
Message-ID: 20190517183421.3k7rbltnv7g7u6nj@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-17 19:10:18 Re: pgindent run next week?
Previous Message Ashwin Agrawal 2019-05-17 18:26:29 Create TOAST table only if AM needs