From: Michael Paquier <michael@paquier.xyz>
To: Bossart, Nathan <bossartn@amazon.com>
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: Tue, 29 Jan 2019 11:35:26 +0900
Message-ID: <20190129023526.GA3121@paquier.xyz> (raw)
In-Reply-To: <F8E72C02-C1D7-4193-A416-B9147A9F1511@amazon.com>
References: <CAD21AoAqsSoTFWjajz1yycwxDnLZSWfV7wT7mmMBqy2k-jkLUQ@mail.gmail.com>
<20190109043316.GH21835@paquier.xyz>
<CAD21AoCzekiuDaGN-JqtoLgaYqqxGQ6nTcNqN0bm1EkvmcUKPA@mail.gmail.com>
<5C971918-E566-41AB-895A-C4793D56B041@amazon.com>
<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>
On Mon, Jan 28, 2019 at 09:58:17PM +0000, Bossart, Nathan wrote:
> Yes, this simplifies the code quite a bit. I did it this way in
> v6.
Thanks for the quick update. Things could have been made a bit more
simple by just using a for loop instead of while, even if the table
list can be NULL for database-wide operations (perhaps that's a matter
of taste..). prepare_vacuum_command() could be simplified further by
using the server version instead of the full connection string. The
comments at the top of the routine were not properly updated either,
and the last portion appending the relation name just needs one
appendPQExpBuffer() call instead of three separate calls. PQclear()
could have been moved closer to where all the query results have been
consumed, to make the whole more consistent.
Anyway, patches 1 and 2 have been merged, and committed after some
cleanup and adjustments. Patch 3 gets much easier now.
- " ON c.relnamespace OPERATOR(pg_catalog.=) ns.oid\n");
+ " ON c.relnamespace OPERATOR(pg_catalog.=) ns.oid\n"
+ " LEFT JOIN pg_catalog.pg_class t"
+ " ON c.reltoastrelid OPERATOR(pg_catalog.=) t.oid\n");
Why do need this part?
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, bossartn@amazon.com, sawada.mshk@gmail.com, robertmhaas@gmail.com
Subject: Re: A few new options for vacuumdb
In-Reply-To: <20190129023526.GA3121@paquier.xyz>
* 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