pgsql: VACUUM VERBOSE: Count "newly deleted" index pages.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: VACUUM VERBOSE: Count "newly deleted" index pages.
Date: 2021-02-25 22:34:06
Message-ID: E1lFPCw-0006pm-Mg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

VACUUM VERBOSE: Count "newly deleted" index pages.

Teach VACUUM VERBOSE to report on pages deleted by the _current_ VACUUM
operation -- these are newly deleted pages. VACUUM VERBOSE continues to
report on the total number of deleted pages in the entire index (no
change there). The former is a subset of the latter.

The distinction between each category of deleted index page only arises
with index AMs where page deletion is supported and is decoupled from
page recycling for performance reasons.

This is follow-up work to commit e5d8a999, which made nbtree store
64-bit XIDs (not 32-bit XIDs) in pages at the point at which they're
deleted. Note that the btm_last_cleanup_num_delpages metapage field
added by that commit usually gets set to pages_newly_deleted. The
exceptions (the scenarios in which they're not equal) all seem to be
tricky cases for the implementation (of page deletion and recycling) in
general.

Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Discussion: https://postgr.es/m/CAH2-WznpdHvujGUwYZ8sihX%3Dd5u-tRYhi-F4wnV2uN2zHpMUXw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2376361839091b0dcdcc0b77f938b809b5f21646

Modified Files
--------------
src/backend/access/gin/ginvacuum.c | 1 +
src/backend/access/gist/gistvacuum.c | 19 ++++++++++--
src/backend/access/heap/vacuumlazy.c | 4 ++-
src/backend/access/nbtree/nbtpage.c | 54 +++++++++++++++++++----------------
src/backend/access/nbtree/nbtree.c | 33 ++++++++-------------
src/backend/access/spgist/spgvacuum.c | 1 +
src/include/access/genam.h | 10 +++++--
src/include/access/nbtree.h | 16 ++++++++++-
8 files changed, 85 insertions(+), 53 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-02-26 01:47:44 pgsql: Fix list-manipulation bug in WITH RECURSIVE processing.
Previous Message Tom Lane 2021-02-25 18:33:34 pgsql: Doc: remove src/backend/regex/re_syntax.n.