Re: [Proposal] Allow users to specify multiple tables in VACUUM commands

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Date: 2017-09-05 03:32:12
Message-ID: CANP8+jJLA2ikvsM2oCS26-H85f9RopfP0fuBW6Jnr_GXocRhMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 September 2017 at 02:16, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:
> On Mon, Sep 4, 2017 at 11:47 PM, Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
>> I've made this change in v14 of the main patch.
>>
>> In case others had opinions regarding the de-duplication patch, I've
>> attached that again as well.
>
> + /*
> + * Create the relation list in a long-lived memory context so that it
> + * survives transaction boundaries.
> + */
> + old_cxt = MemoryContextSwitchTo(AutovacMemCxt);
> + rangevar = makeRangeVar(tab->at_nspname, tab->at_relname, -1);
> + rel = makeVacuumRelation(rangevar, NIL, tab->at_relid);
> + rel_list = list_make1(rel);
> + MemoryContextSwitchTo(old_cxt);
> That's way better, thanks for the new patch.
>
> So vacuum_multiple_tables_v14.patch is good for a committer in my
> opinion. With this patch, if the same relation is specified multiple
> times, then it gets vacuum'ed that many times. Using the same column
> multi-times results in an error as on HEAD, but that's not a new
> problem with this patch.
>
> So I would tend to think that the same column specified multiple times
> should cause an error, and that we could let VACUUM run work N times
> on a relation if it is specified this much. This feels more natural,
> at least to me, and it keeps the code simple.

ISTM there is no difference between
VACUUM a, b
and
VACUUM a; VACUUM b;

If we want to keep the code simple we must surely consider whether the
patch has any utility.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ryan Murphy 2017-09-05 03:41:50 Re: Useless code in ExecInitModifyTable
Previous Message Michael Paquier 2017-09-05 03:24:37 Re: [Proposal] Allow users to specify multiple tables in VACUUM commands