pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Separate vacuum cost variables from GUCs
Date: Thu, 06 Apr 2023 23:03:23 +0000
Message-ID: <E1pkYdW-001kmo-3A@gemulon.postgresql.org> (raw)

Separate vacuum cost variables from GUCs

Vacuum code run both by autovacuum workers and a backend doing
VACUUM/ANALYZE previously inspected VacuumCostLimit and VacuumCostDelay,
which are the global variables backing the GUCs vacuum_cost_limit and
vacuum_cost_delay.

Autovacuum workers needed to override these variables with their
own values, derived from autovacuum_vacuum_cost_limit and
autovacuum_vacuum_cost_delay and worker cost limit balancing logic.
This led to confusing code which, in some cases, both derived and
set a new value of VacuumCostLimit from VacuumCostLimit.

In preparation for refreshing these GUC values more often, introduce
new, independent global variables and add a function to update them
using the GUCs and existing logic.

Per suggestion by Kyotaro Horiguchi

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAAKRu_ZngzqnEODc7LmS1NH04Kt6Y9huSjz5pp7%2BDXhrjDA0gw%40m...

Branch
------
master

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

Modified Files
--------------
src/backend/commands/vacuum.c         | 29 +++++++++++++++++++----------
src/backend/commands/vacuumparallel.c |  3 ++-
src/backend/postmaster/autovacuum.c   | 34 ++++++++++++++--------------------
src/include/commands/vacuum.h         |  5 +++++
src/include/postmaster/autovacuum.h   |  3 ---
5 files changed, 40 insertions(+), 34 deletions(-)



Message-ID: <E1pkYdW-001kmo-3A@gemulon.postgresql.org>
Permalink:  ../E1pkYdW-001kmo-3A@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pkYdW-001kmo-3A@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: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Separate vacuum cost variables from GUCs
  In-Reply-To: <E1pkYdW-001kmo-3A@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