postgresql/src/backend/utils/sort
Peter Geoghegan d088ba5a5a nbtree: Allocate new pages in separate function.
Split nbtree's _bt_getbuf function is two: code that read locks or write
locks existing pages remains in _bt_getbuf, while code that deals with
allocating new pages is moved to a new, dedicated function called
_bt_allocbuf.  This simplifies most _bt_getbuf callers, since it is no
longer necessary for them to pass a heaprel argument.  Many of the
changes to nbtree from commit 61b313e4 can be reverted.  This minimizes
the divergence between HEAD/PostgreSQL 16 and earlier release branches.

_bt_allocbuf replaces the previous nbtree idiom of passing P_NEW to
_bt_getbuf.  There are only 3 affected call sites, all of which continue
to pass a heaprel for recovery conflict purposes.  Note that nbtree's
use of P_NEW was superficial; nbtree never actually relied on the P_NEW
code paths in bufmgr.c, so this change is strictly mechanical.

GiST already took the same approach; it has a dedicated function for
allocating new pages called gistNewBuffer().  That factor allowed commit
61b313e4 to make much more targeted changes to GiST.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CAH2-Wz=8Z9qY58bjm_7TAHgtW6RzZ5Ke62q5emdCEy9BAzwhmg@mail.gmail.com
2023-06-10 14:08:25 -07:00
..
logtape.c Introduce PG_IO_ALIGN_SIZE and align all I/O buffers. 2023-04-08 16:34:50 +12:00
Makefile Split tuplesortvariants.c from tuplesort.c 2022-07-27 08:28:26 +03:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
qsort_interruptible.c
sharedtuplestore.c Allocate hash join files in a separate memory context 2023-05-19 17:17:58 +02:00
sortsupport.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
tuplesort.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
tuplesortvariants.c nbtree: Allocate new pages in separate function. 2023-06-10 14:08:25 -07:00
tuplestore.c Simplify useless 0L constants 2023-03-29 08:25:12 +02:00