Re: Modest proposal to extend TableAM API for controlling cluster commands - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Modest proposal to extend TableAM API for controlling cluster commands
Date
Msg-id CAKFQuwaMggG6iYRSx08SvXh=sd+8JrCuaYWhCDn7z8xWAGXEhw@mail.gmail.com
Whole thread Raw
In response to Re: Modest proposal to extend TableAM API for controlling cluster commands  (Andres Freund <andres@anarazel.de>)
Responses Re: Modest proposal to extend TableAM API for controlling cluster commands  (Mark Dilger <mark.dilger@enterprisedb.com>)
List pgsql-hackers
On Wed, Jun 15, 2022 at 8:18 PM Andres Freund <andres@anarazel.de> wrote:
> If a simple callback like
> relation_supports_cluster(Relation rel) is too simplistic

Seems like it should be called: relation_supports_compaction[_by_removal_of_interspersed_dead_tuples]

Basically, if the user tells the table to make itself smaller on disk by removing dead tuples, should we support the case where the Table AM says: "Sorry, I cannot do that"?

If yes, then naming the table explicitly should elicit an error.  Having the table chosen implicitly should provoke a warning.  For ALTER TABLE CLUSTER there should be an error: which makes the implicit CLUSTER command a non-factor.

However, given that should the table structure change it is imperative that the Table AM be capable of producing a new physical relation with the correct data, which will have been compacted as a side-effect, it seems like, explicit or implicit, expecting any Table AM to do that when faced with Vacuum Full is reasonable.  Which leaves deciding how to allow a table with a given TAM to prevent itself from being added to the CLUSTER roster.  And decide whether an opt-out feature for implicit VACUUM FULL is something we should offer as well.

I'm doubtful that a TAM that is pluggable into the MVCC and WAL architecture of PostgreSQL could avoid this basic contract between the system and its users.

David J.

pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: warn if GUC set to an invalid shared library
Next
From: Michael Paquier
Date:
Subject: Re: Extending USING [heap | mytam | yourtam] grammar and behavior