pgsql: Move fake LSN infrastructure out of GiST.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move fake LSN infrastructure out of GiST.
Date: 2026-03-13 23:38:30
Message-ID: E1w1C5N-0002u7-06@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move fake LSN infrastructure out of GiST.

Move utility functions used by GiST to generate fake LSNs into xlog.c
and xloginsert.c, so that other index AMs can also generate fake LSNs.

Preparation for an upcoming commit that will add support for fake LSNs
to nbtree, allowing its dropPin optimization to be used during scans of
unlogged relations. That commit is itself preparation for another
upcoming commit that will add a new amgetbatch/btgetbatch interface to
enable I/O prefetching.

Bump XLOG_PAGE_MAGIC due to XLOG_GIST_ASSIGN_LSN becoming
XLOG_ASSIGN_LSN.

Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Reviewed-By: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-By: Tomas Vondra <tomas(at)vondra(dot)me>
Discussion: https://postgr.es/m/CAH2-WzkehuhxyuA8quc7rRN3EtNXpiKsjPfO8mhb+0Dr2K0Dtg@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/gist/gist.c | 6 ++--
src/backend/access/gist/gistutil.c | 50 -------------------------------
src/backend/access/gist/gistvacuum.c | 8 ++---
src/backend/access/gist/gistxlog.c | 21 -------------
src/backend/access/rmgrdesc/gistdesc.c | 6 ----
src/backend/access/rmgrdesc/xlogdesc.c | 7 +++++
src/backend/access/transam/xlog.c | 28 ++++++++++++++++++
src/backend/access/transam/xloginsert.c | 52 +++++++++++++++++++++++++++++++++
src/backend/storage/buffer/bufmgr.c | 6 ++--
src/include/access/gist_private.h | 4 ---
src/include/access/gistxlog.h | 2 +-
src/include/access/xlog.h | 1 +
src/include/access/xlog_internal.h | 2 +-
src/include/access/xloginsert.h | 2 ++
src/include/catalog/pg_control.h | 2 +-
15 files changed, 103 insertions(+), 94 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2026-03-14 00:38:21 pgsql: Use fake LSNs to improve nbtree dropPin behavior.
Previous Message Jeff Davis 2026-03-13 23:09:02 pgsql: Add error code to user-visible message.