Re: Support for VACUUMing Foreign Tables

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support for VACUUMing Foreign Tables
Date: 2021-05-14 11:11:29
Message-ID: 511fd8a129cb23beab539eb9d721d01c3da02857.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2021-05-13 at 09:44 +0530, Bharath Rupireddy wrote:
> I think it will be useful to allow foreign tables to be VACUUMed if
> the underlying FDW supports, currently VACUUM doesn't support foreign
> tables, see [1]. In case of postgres_fdw, if foreign tables are
> specified in the local VACUUM command, a per-server remote VACUUM
> command can be prepared with the foreign tables that belong to the
> same server and sent to the foreign server. This design is similar to
> TRUNCATE on foreign tables committed as part of 8ff1c946. Although,
> this may not be much useful for FDWs that connect to remote non-MVCC
> databases where the concept of VACUUM may not apply, but for
> postgres_fdw and others it might help.
>
> I would like to hear opinions from the hackers. If it's not
> possible/feasible to do this, please let me know the reasons. Thanks.

I see no value in this.

First, it wouldn't make sense for anything except postgres_fdw, so
I think it should not be part of the FDW API. If anything, it should
mean that knowledge about postgres_fdw gets hardwired into VACUUM.

But I don't think that is a smart idea either. Each database cluster
is in charge of vacuuming its own tables, so the better approach would
be to tune autovacuum on the remote side so that it does the right thing.

Yours,
Laurenz Albe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-05-14 12:04:00 Re: naming of async_mode parameter
Previous Message Pengchengliu 2021-05-14 10:35:53 RE: Parallel scan with SubTransGetTopmostTransaction assert coredump