Re: A few new options for vacuumdb - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: A few new options for vacuumdb
Date
Msg-id ABDB7F5F-C30D-4CEF-855F-9A53B1049F49@amazon.com
Whole thread Raw
In response to Re: A few new options for vacuumdb  (Michael Paquier <michael@paquier.xyz>)
Responses Re: A few new options for vacuumdb  (Michael Paquier <michael@paquier.xyz>)
List 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


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well
Next
From: Tom Lane
Date:
Subject: Re: Proposed refactoring of planner header files