Re: A few new options for vacuumdb
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-01-31T02:28:05Z
Lists: pgsql-hackers
On 1/30/19, 6:04 PM, "Michael Paquier" <michael@paquier.xyz> wrote: > Something which was not correct in the patch is the compatibility of > the query. xid <> xid has been added in 9.6, so the new options will > not be able to work with older versions. The versions marked as > compatible in the last patch came from the age-ing functions, but you > added direct comparisons with relfrozenxid and relminmxid in the > latest versions of the patch. This implementation goes down a couple > of released versions, which is useful enough in my opinion, so I would > keep it as-is. Agreed. Thanks for catching this. > I have added as well some markups around "PostgreSQL" in the docs, and > extra casts for the integer/xid values of the query. The test > patterns are also simplified, and I added tests for incorrect values > of --min-xid-age and --min-mxid-age. Does that look correct to you? It looks good to me. The only thing I noticed is the use of relfrozenxid instead of relminmxid here: + appendPQExpBuffer(&catalog_query, + " %s GREATEST(pg_catalog.mxid_age(c.relminmxid)," + " pg_catalog.mxid_age(t.relminmxid)) OPERATOR(pg_catalog.>=)" + " '%d'::pg_catalog.int4\n" + " AND c.relfrozenxid OPERATOR(pg_catalog.!=)" + " '0'::pg_catalog.xid\n", + has_where ? "AND" : "WHERE", vacopts->min_mxid_age); However, that may still work as intended. Nathan
Commits
-
Add --min-xid-age and --min-mxid-age options to vacuumdb
- 00d1e88d3668 12.0 landed
-
Do not filter by relkind in vacuumdb's catalog query if --table is used
- b8f73df0f845 12.0 landed
-
Use catalog query to discover tables to process in vacuumdb
- e0c2933a767c 12.0 landed
-
Add TAP tests for vacuumdb with column lists
- 0803b0ae1ed6 12.0 landed
-
Make vacuumdb test regex more modular for its query output
- adaaacae658e 12.0 landed
-
Adjust documentation for vacuumdb --disable-page-skipping
- efab708997dc 12.0 landed
-
Add --disable-page-skipping and --skip-locked to vacuumdb
- 354e95d1f212 12.0 landed