pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove batching from RI fast-path checks
Date: Sat, 03 Oct 2026 02:46:15 +0000
Message-ID: <E1xCplP-0000000066B-2POy@gemulon.postgresql.org> (raw)

Remove batching from RI fast-path checks

This removes the buffering of FK rows for batched PK index probes,
along with the after-trigger callback infrastructure used only by
batching.  The per-row fast path, which probes the PK index directly
instead of going through SPI, remains.  This is a cherry-pick of
commit 25649d6e791c2, which made the same change in REL_19_STABLE,
adjusted for some drift between the branches.

I (amitlan) initially thought we could keep improving the batching
path on master by fixing its remaining bugs and other issues as
they were found.  However, we are still finding cases where delaying
checks to accumulate a batch changes their results, such as when other
AFTER ROW triggers modify the referenced table.  Individual cases can
be addressed, but new ones keep turning up, which makes it hard to be
confident that fixing the known ones will be enough.  It seems better
to rip batching out and reconsider how to introduce it, or at least
its useful pieces, while preserving the semantics of per-row checks.

Discussion: https://postgr.es/m/CA+HiwqFx4cjFtC3akr1DW-cPYw+B-EkCSffZPrkpTef8PNS6qA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/425daf545d9146e008220ae0b21415982220cd3f

Modified Files
--------------
src/backend/access/transam/xact.c                  |   2 -
src/backend/commands/trigger.c                     | 206 +----
src/backend/utils/adt/ri_triggers.c                | 979 +--------------------
src/include/commands/trigger.h                     |  24 -
src/test/isolation/isolation_schedule              |   2 +-
.../specs/ri_fastpath_reindex.spec                 |  12 +-
src/test/regress/expected/foreign_key.out          | 347 +-------
src/test/regress/expected/triggers.out             |  24 -
src/test/regress/sql/foreign_key.sql               | 305 +------
src/test/regress/sql/triggers.sql                  |  23 -
src/tools/pgindent/typedefs.list                   |   4 -
11 files changed, 131 insertions(+), 1797 deletions(-)



view thread (2+ messages)

Message-ID: <E1xCplP-0000000066B-2POy@gemulon.postgresql.org>
Permalink:  ../E1xCplP-0000000066B-2POy@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xCplP-0000000066B-2POy@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 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: amitlan@postgresql.org
  Subject: Re: pgsql: Remove batching from RI fast-path checks
  In-Reply-To: <E1xCplP-0000000066B-2POy@gemulon.postgresql.org>
  References: <E1xCplP-0000000066B-2POy@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