pgsql: Use catalog query to discover tables to process in vacuumdb - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Use catalog query to discover tables to process in vacuumdb
Date
Msg-id E1goJ8X-0006Af-8h@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Use catalog query to discover tables to process in vacuumdb

vacuumdb would use a catalog query only when the command caller does not
define a list of tables.  Switching to a catalog table represents two
advantages:
- Relation existence check can happen before running any VACUUM or
ANALYZE query.  Before this change, if multiple relations are defined
using --table, the utility would fail only after processing the
firstly-defined ones, which may be a long some depending on the size of
the relation.  This adds checks for the relation names, and does
nothing, at least yet, for the attribute names.
- More filtering options can become available for the utility user.
These options, which may be introduced later on, are based on the
relation size or the relation age, and need to be made available even if
the user does not list any specific table with --table.

Author: Nathan Bossart
Reviewed-by: Michael Paquier, Masahiko Sawada
Discussion: https://postgr.es/m/FFE5373C-E26A-495B-B5C8-911EC4A41C5E@amazon.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e0c2933a767c652429ddef674622b4656fa43092

Modified Files
--------------
src/bin/scripts/common.c   |   8 +-
src/bin/scripts/common.h   |   3 +
src/bin/scripts/vacuumdb.c | 210 ++++++++++++++++++++++++++++++---------------
3 files changed, 147 insertions(+), 74 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Fix LLVM related headers to compile standalone (to fixcplusplus
Next
From: Etsuro Fujita
Date:
Subject: pgsql: postgres_fdw: Fix test for cached costs inestimate_path_cost_si