pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rationalize handling of VacuumParams
Date: Mon, 30 Jun 2025 06:44:11 +0000
Message-ID: <E1uW8FP-003zyR-0U@gemulon.postgresql.org> (raw)

Rationalize handling of VacuumParams

This commit refactors the vacuum routines that rely on VacuumParams,
adding const markers where necessary to force a new policy in the code.
This structure should not use a pointer as it may be used across
multiple relations, and its contents should never be updated.
vacuum_rel() stands as an exception as it touches the "index_cleanup"
and "truncate" options.

VacuumParams has been introduced in 0d831389749a, and 661643dedad9 has
fixed a bug impacting VACUUM operating on multiple relations.  The
changes done in tableam.h break ABI compatibility, so this commit can
only happen on HEAD.

Author: Shihao Zhong <zhong950419@gmail.com>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://postgr.es/m/CAGRkXqTo+aK=GTy5pSc-9cy8H2F2TJvcrZ-zXEiNJj93np1UUw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2252fcd4276cfeabae8786ab7c5a421dd674743e

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c |  44 ++++++-------
src/backend/commands/analyze.c       |  26 ++++----
src/backend/commands/cluster.c       |   2 +-
src/backend/commands/vacuum.c        | 118 ++++++++++++++++-------------------
src/backend/postmaster/autovacuum.c  |   2 +-
src/include/access/heapam.h          |   4 +-
src/include/access/tableam.h         |   6 +-
src/include/commands/vacuum.h        |   6 +-
8 files changed, 98 insertions(+), 110 deletions(-)



Message-ID: <E1uW8FP-003zyR-0U@gemulon.postgresql.org>
Permalink:  ../E1uW8FP-003zyR-0U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uW8FP-003zyR-0U@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Rationalize handling of VacuumParams
  In-Reply-To: <E1uW8FP-003zyR-0U@gemulon.postgresql.org>

* 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