pgsql: Clarify why _bt_killitems sorts its items array.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Clarify why _bt_killitems sorts its items array.
Date: 2025-12-11 01:51:12
Message-ID: E1vTVpn-0004RC-2C@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clarify why _bt_killitems sorts its items array.

Make it clear why _bt_killitems sorts the scan's so->killedItems[]
array. Also add an assertion to the _bt_killitems loop (that iterates
through this array) to verify it accesses tuples in leaf page order.

Follow-up to commit bfb335df58.

Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Suggested-by: Victor Yegorov <vyegorov(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAGnEboirgArezZDNeFrR8FOGvKF-Xok333s2iVwWi65gZf8MEA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2025-12-11 03:59:08 pgsql: Enhance slot synchronization API to respect promotion signal.
Previous Message Michael Paquier 2025-12-11 01:27:16 pgsql: Fix allocation formula in llvmjit_expr.c