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

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Date: 2017-05-18 05:45:42
Message-ID: CAD21AoD6tmw3eEVJdK8Fu6JrvLPdpa6LGba1xmv_Fw_5OC1bVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 18, 2017 at 7:38 AM, Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
> I’ve attached a v4 of the patch.
>
> Changes:
> - Early in vacuum(…), emit an ERROR if any specified columns do not exist.
> - Emit a WARNING and skip any specified tables or columns that disappear before they are actually processed.
> - Small additions to the VACUUM regression test.
> - Rebased with master.
>

Thank you for updating the patch.

Some review comments.

I got the following warning messages when building. You might want to
include parser/parse_relation.h.

vacuum.c: In function ‘check_columns_exist’:
vacuum.c:567: warning: implicit declaration of function ‘attnameAttNum’
--

=# vacuum (verbose) hoge, hoge;
INFO: vacuuming "public.hoge"
INFO: "hoge": found 0 removable, 0 nonremovable row versions in 0 out
of 0 pages
DETAIL: 0 dead row versions cannot be removed yet, oldest xmin: 604
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins, 0 frozen pages.
0 pages are entirely empty.
CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
INFO: vacuuming "public.hoge"
INFO: "hoge": found 0 removable, 0 nonremovable row versions in 0 out
of 0 pages
DETAIL: 0 dead row versions cannot be removed yet, oldest xmin: 604
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins, 0 frozen pages.
0 pages are entirely empty.
CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
VACUUM

Even if the same relation is specified more than once, we should
vacuum the relation only once. Similarly if we specify the parent
table and its child table we want to vacuum each relation only once.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vaishnavi Prabakaran 2017-05-18 05:47:53 Re: Disallowing multiple queries per PQexec()
Previous Message Michael Paquier 2017-05-18 05:40:25 Re: [bug fix] PG10: libpq doesn't connect to alternative hosts when some errors occur