1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-27 22:56:53 +03:00

Move nbtree preprocessing into new .c file.

Quite a bit of code within nbtutils.c is only called during nbtree
preprocessing.  Move that code into a new .c file, nbtpreprocesskeys.c.
Also reorder some of the functions within the new file for clarity.

This commit has no functional impact.  It is strictly mechanical.

Author: Peter Geoghegan <pg@bowt.ie>
Suggested-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CAH2-WznwNn1BDOpWxHBUK1f3Rdw8pO9UCenWXnvT=n9GO8GnLA@mail.gmail.com
Discussion: https://postgr.es/m/86930045-5df5-494a-b4f1-815bc3fbcce0%40iki.fi
This commit is contained in:
Peter Geoghegan 2025-01-13 12:15:00 -05:00
parent a8a762bc46
commit 597b1ffbf1
5 changed files with 1878 additions and 1859 deletions

View File

@ -17,6 +17,7 @@ OBJS = \
nbtdedup.o \ nbtdedup.o \
nbtinsert.o \ nbtinsert.o \
nbtpage.o \ nbtpage.o \
nbtpreprocesskeys.o \
nbtree.o \ nbtree.o \
nbtsearch.o \ nbtsearch.o \
nbtsort.o \ nbtsort.o \

View File

@ -5,6 +5,7 @@ backend_sources += files(
'nbtdedup.c', 'nbtdedup.c',
'nbtinsert.c', 'nbtinsert.c',
'nbtpage.c', 'nbtpage.c',
'nbtpreprocesskeys.c',
'nbtree.c', 'nbtree.c',
'nbtsearch.c', 'nbtsearch.c',
'nbtsort.c', 'nbtsort.c',

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1260,6 +1260,11 @@ extern void _bt_pendingfsm_init(Relation rel, BTVacState *vstate,
bool cleanuponly); bool cleanuponly);
extern void _bt_pendingfsm_finalize(Relation rel, BTVacState *vstate); extern void _bt_pendingfsm_finalize(Relation rel, BTVacState *vstate);
/*
* prototypes for functions in nbtpreprocesskeys.c
*/
extern void _bt_preprocess_keys(IndexScanDesc scan);
/* /*
* prototypes for functions in nbtsearch.c * prototypes for functions in nbtsearch.c
*/ */
@ -1277,8 +1282,12 @@ extern Buffer _bt_get_endpoint(Relation rel, uint32 level, bool rightmost);
extern BTScanInsert _bt_mkscankey(Relation rel, IndexTuple itup); extern BTScanInsert _bt_mkscankey(Relation rel, IndexTuple itup);
extern void _bt_freestack(BTStack stack); extern void _bt_freestack(BTStack stack);
extern bool _bt_start_prim_scan(IndexScanDesc scan, ScanDirection dir); extern bool _bt_start_prim_scan(IndexScanDesc scan, ScanDirection dir);
extern int _bt_binsrch_array_skey(FmgrInfo *orderproc,
bool cur_elem_trig, ScanDirection dir,
Datum tupdatum, bool tupnull,
BTArrayKeyInfo *array, ScanKey cur,
int32 *set_elem_result);
extern void _bt_start_array_keys(IndexScanDesc scan, ScanDirection dir); extern void _bt_start_array_keys(IndexScanDesc scan, ScanDirection dir);
extern void _bt_preprocess_keys(IndexScanDesc scan);
extern bool _bt_checkkeys(IndexScanDesc scan, BTReadPageState *pstate, bool arrayKeys, extern bool _bt_checkkeys(IndexScanDesc scan, BTReadPageState *pstate, bool arrayKeys,
IndexTuple tuple, int tupnatts); IndexTuple tuple, int tupnatts);
extern bool _bt_oppodir_checkkeys(IndexScanDesc scan, ScanDirection dir, extern bool _bt_oppodir_checkkeys(IndexScanDesc scan, ScanDirection dir,