pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Be more consistent about whether to update the FSM while vacuumi
Date: Tue, 16 Jan 2024 19:21:44 +0000
Message-ID: <E1rPp0K-001j91-5z@gemulon.postgresql.org> (raw)

Be more consistent about whether to update the FSM while vacuuming.

Previously, when lazy_scan_noprune() was called and returned true, we would
update the FSM immediately if the relation had no indexes or if the page
contained no dead items. On the other hand, when lazy_scan_prune() was
called, we would update the FSM if either of those things was true or
if index vacuuming was disabled. Eliminate that behavioral difference by
considering vacrel->do_index_vacuuming in both cases.

Also, make lazy_scan_heap() responsible for deciding whether to update
the FSM, instead of doing it inside lazy_scan_noprune(). This is
more consistent with the lazy_scan_prune() case. lazy_scan_noprune()
still needs an output parameter for whether there are LP_DEAD items
on the page, but the real decision-making now happens in the caller.

Patch by me, reviewed by Peter Geoghegan and Melanie Plageman.

Discussion: http://postgr.es/m/CA+TgmoaOzvN1TcHd9iej=PR3fY40En1USxzOnXSR2CxCLaRM0g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/45d395cd75ffc5b4c824467140127a5d11696d4c

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 59 ++++++++++++++++++------------------
1 file changed, 30 insertions(+), 29 deletions(-)



Message-ID: <E1rPp0K-001j91-5z@gemulon.postgresql.org>
Permalink:  ../E1rPp0K-001j91-5z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rPp0K-001j91-5z@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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Be more consistent about whether to update the FSM while vacuumi
  In-Reply-To: <E1rPp0K-001j91-5z@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