Thread
Commits
-
Move nbtree preprocessing into new .c file.
- 597b1ffbf123 18.0 landed
-
Moving nbtree preprocessing code into a new .c file
Peter Geoghegan <pg@bowt.ie> — 2025-01-09T18:01:38Z
At one point during my work on nbtree SAOP scans (during the Postgres 17 cycle), Heikki suggested that I move all nbtree preprocessing code into its own file. For whatever reason I didn't follow-up on his suggestion at the time. The nbtree skip scan patch will add quite a bit more preprocessing code, though, so now seems like a good time to follow up -- better late than never. Attached mechanical patch relocates all code that only runs during nbtree preprocessing into a new file, nbtpreprocesskeys.c. I verified that the changes in the patch were strictly mechanical using "git diff --no-ext-diff --color --color-moved=dimmed-zebra master". Note that there was some minor reordering of the functions in the new nbtpreprocesskeys.c, relative to their original nbtutils.c order. The reordering puts _bt_preprocess_array_keys and related routines towards the end of the file (not at the start, as in nbtutils.c). Naturally, nbtpreprocesskeys.c starts with _bt_preprocess_keys() itself, since that is the only externally callable function. There was also some minor reordering within _bt_preprocess_keys-owned functions, to make the order consistent with the actual order in which each function is first called by _bt_preprocess_keys (I wouldn't usually bother with this kind of reordering, but it's worth doing now). -- Peter Geoghegan