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

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

Peter Geoghegan-4
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

Author: Peter Geoghegan <[hidden email]>



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(-)