Re: A few new options for vacuumdb

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A few new options for vacuumdb
Date: 2019-01-04 23:49:46
Message-ID: 579F2B3A-4EA5-4032-AAD9-4AEE9219A4AB@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/21/18, 11:14 AM, "Bossart, Nathan" <bossartn(at)amazon(dot)com> wrote:
> On 12/21/18, 10:51 AM, "Robert Haas" <robertmhaas(at)gmail(dot)com> wrote:
>> On Thu, Dec 20, 2018 at 11:48 AM Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
>>> Either way, we'll still have to decide whether to fail or to silently
>>> skip the option if you do something like specify --min-mxid-age for a
>>> 9.4 server.
>>
>> +1 for fail.
>
> Sounds good. I'll keep all the version checks and will fail for
> unsupported options in the next patch set.

Here's an updated set of patches with the following changes:

- 0002 adds the parenthesized syntax for ANALYZE.
- 0003 adds DISABLE_PAGE_SKIPPING for VACUUM.
- 0003 also ensures SKIP_LOCKED is applied for --analyze-only.
- 0004 alters vacuumdb to always use the catalog query to discover
the list of tables to process.
- 0003, 0005, and 0006 now fail in vacuum_one_database() if a
specified option is not available on the server version.
- If tables are listed along with --min-xid-age, --min-mxid-age, or
--min-relation-size, each table is processed only if it satisfies
the provided options.

0004 introduces a slight change to existing behavior. Currently, if
you specify a missing table, vacuumdb will process each table until
it reaches the nonexistent one, at which point it will fail. After
0004 is applied, vacuumdb will fail during the catalog query, and no
tables will be processed. I considered avoiding this change in
behavior by doing an additional catalog lookup for each specified
table to see whether it satisfies --min-xid-age, etc. However, this
introduced quite a bit more complexity and increased the number of
catalog queries needed.

Nathan

Attachment Content-Type Size
v2-0006-Add-min-relation-size-option-to-vacuumdb.patch application/octet-stream 4.8 KB
v2-0001-Do-not-process-any-relations-if-the-catalog-query.patch application/octet-stream 1.6 KB
v2-0002-Support-parenthesized-syntax-for-ANALYZE-in-vacuu.patch application/octet-stream 2.7 KB
v2-0003-Add-disable-page-skipping-and-skip-locked-to-vacu.patch application/octet-stream 6.6 KB
v2-0004-Always-use-a-catalog-query-to-discover-tables-to-.patch application/octet-stream 9.8 KB
v2-0005-Add-min-xid-age-and-min-mxid-age-options-to-vacuu.patch application/octet-stream 6.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2019-01-04 23:54:51 Re: [PATCH] Log PostgreSQL version number on startup
Previous Message Joerg Sonnenberger 2019-01-04 23:38:45 Re: reducing the footprint of ScanKeyword (was Re: Large writable variables)