pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bossart, Nathan <bossartn@amazon.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: A few new options for vacuumdb
Date: Thu, 31 Jan 2019 02:28:05 +0000
Message-ID: <ABDB7F5F-C30D-4CEF-855F-9A53B1049F49@amazon.com> (raw)
In-Reply-To: <20190131020335.GF16781@paquier.xyz>
References: <20190122060730.GD8719@paquier.xyz>
	<F716EB06-0CBE-4342-9CFA-23409319B52A@amazon.com>
	<20190123034111.GH3873@paquier.xyz>
	<26A57CB3-2847-495F-93CA-9358959CDAD4@amazon.com>
	<20190128055702.GB15401@paquier.xyz>
	<F8E72C02-C1D7-4193-A416-B9147A9F1511@amazon.com>
	<20190129023526.GA3121@paquier.xyz>
	<32049A78-C429-4742-AEC1-941C9ABDE7B8@amazon.com>
	<20190130004653.GK3121@paquier.xyz>
	<5E292853-2CC1-4D7A-9613-7A6ED049CE49@amazon.com>
	<20190131020335.GF16781@paquier.xyz>

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



view thread (35+ messages)  latest in thread

Message-ID: <ABDB7F5F-C30D-4CEF-855F-9A53B1049F49@amazon.com>
Permalink:  ../ABDB7F5F-C30D-4CEF-855F-9A53B1049F49@amazon.com/
Also on:    postgresql.org/message-id/ABDB7F5F-C30D-4CEF-855F-9A53B1049F49@amazon.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: bossartn@amazon.com, michael@paquier.xyz, sawada.mshk@gmail.com, robertmhaas@gmail.com
  Subject: Re: A few new options for vacuumdb
  In-Reply-To: <ABDB7F5F-C30D-4CEF-855F-9A53B1049F49@amazon.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox