pgsql: vacuumdb: Teach vacuum_one_database() to reuse query results.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: vacuumdb: Teach vacuum_one_database() to reuse query results.
Date: 2025-03-18 21:33:42
Message-ID: E1tueZC-0039rg-2J@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

vacuumdb: Teach vacuum_one_database() to reuse query results.

Presently, each call to vacuum_one_database() queries the catalogs
to retrieve the list of tables to process. A follow-up commit will
add a "missing stats only" feature to --analyze-in-stages, which
requires saving the catalog query results (since tables without
statistics will have them after the first stage). This commit adds
a new parameter to vacuum_one_database() that specifies either a
previously-retrieved list or a place to return the catalog query
results. Note that nothing uses this new parameter yet.

Author: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Co-authored-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Reviewed-by: John Naylor <johncnaylorls(at)gmail(dot)com>
Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c03c8d187210f112371aab881b379bd4800562c

Modified Files
--------------
src/bin/scripts/vacuumdb.c | 330 ++++++++++++++++++++++++++-------------------
1 file changed, 194 insertions(+), 136 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-03-18 21:47:23 Re: Increase default maintenance_io_concurrency to 16
Previous Message Bruce Momjian 2025-03-18 21:19:41 Re: Increase default maintenance_io_concurrency to 16