From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove unneeded "pin scan" nbtree VACUUM code.
Date: Thu, 19 Dec 2019 19:37:26 +0000
Message-ID: <E1ii1by-0007C0-2A@gemulon.postgresql.org> (raw)
Remove unneeded "pin scan" nbtree VACUUM code.
The REDO routine for nbtree's xl_btree_vacuum record type hasn't
performed a "pin scan" since commit 3e4b7d87 went in, so clearly there
isn't any point in VACUUM WAL-logging information that won't actually be
used. Finish off the work of commit 3e4b7d87 (and the closely related
preceding commit 687f2cd7) by removing the code that generates this
unused information. Also remove the REDO routine code disabled by
commit 3e4b7d87.
Replace the unneeded lastBlockVacuumed field in xl_btree_vacuum with a
new "ndeleted" field. The new field isn't actually needed right now,
since we could continue to infer the array length from the overall
record length. However, an upcoming patch to add deduplication to
nbtree needs to add an "items updated" field to xl_btree_vacuum, so we
might as well start being explicit about the number of items now.
(Besides, it doesn't seem like a good idea to leave the xl_btree_vacuum
struct without any fields; the C standard says that that's undefined.)
nbtree VACUUM no longer forces writing a WAL record for the last block
in the index. Writing out a WAL record with no items for the final
block was supposed to force processing of a lastBlockVacuumed field by a
pin scan.
Bump XLOG_PAGE_MAGIC because xl_btree_vacuum changed.
Discussion: https://postgr.es/m/CAH2-WzmY_mT7UnTzFB5LBQDBkKpdV5UxP3B5bLb7uP%3D%3D6UQJRQ%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9f83468b3536caf6fb7fe8f9dcdbb108a98d1257
Modified Files
--------------
src/backend/access/nbtree/README | 63 +++++++++++++------
src/backend/access/nbtree/nbtpage.c | 34 +++++------
src/backend/access/nbtree/nbtree.c | 111 +++++++---------------------------
src/backend/access/nbtree/nbtxlog.c | 99 +++---------------------------
src/backend/access/rmgrdesc/nbtdesc.c | 3 +-
src/include/access/nbtree.h | 3 +-
src/include/access/nbtxlog.h | 31 +++-------
src/include/access/xlog_internal.h | 2 +-
8 files changed, 101 insertions(+), 245 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: pg@bowt.ie
Subject: Re: pgsql: Remove unneeded "pin scan" nbtree VACUUM code.
In-Reply-To: <E1ii1by-0007C0-2A@gemulon.postgresql.org>
References: <E1ii1by-0007C0-2A@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