summaryrefslogtreecommitdiff
path: root/src/include/access/nbtree.h
diff options
context:
space:
mode:
authorPeter Geoghegan2025-03-11 14:35:56 +0000
committerPeter Geoghegan2025-03-11 14:35:56 +0000
commit426ea611171da4e60ab4f3863fa3cc3683ae9547 (patch)
tree8186c288021aaabe5b60cd51e82374ad4bd4007e /src/include/access/nbtree.h
parent0fbceae841cb5a31b13d3f284ac8fdd19822eceb (diff)
nbtree: Make BTMaxItemSize into object-like macro.
Make nbtree's "1/3 of a page limit" BTMaxItemSize function-like macro (which accepts a "page" argument) into an object-like macro that can be used from code that doesn't have convenient access to an nbtree page. Preparation for an upcoming patch that adds skip scan to nbtree. Parallel index scans that use skip scan will serialize datums (not just SAOP array subscripts) when scheduling primitive scans. BTMaxItemSize will be used by btestimateparallelscan to determine how much DSM to request. Author: Peter Geoghegan <[email protected]> Discussion: https://postgr.es/m/CAH2-Wz=H_RG5weNGeUG_TkK87tRBnH9mGCQj6WpM4V4FNWKv2g@mail.gmail.com
Diffstat (limited to 'src/include/access/nbtree.h')
-rw-r--r--src/include/access/nbtree.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h
index e4fdeca3402..0c43767f8c3 100644
--- a/src/include/access/nbtree.h
+++ b/src/include/access/nbtree.h
@@ -161,13 +161,13 @@ typedef struct BTMetaPageData
* a heap index tuple to make space for a tiebreaker heap TID
* attribute, which we account for here.
*/
-#define BTMaxItemSize(page) \
- (MAXALIGN_DOWN((PageGetPageSize(page) - \
+#define BTMaxItemSize \
+ (MAXALIGN_DOWN((BLCKSZ - \
MAXALIGN(SizeOfPageHeaderData + 3*sizeof(ItemIdData)) - \
MAXALIGN(sizeof(BTPageOpaqueData))) / 3) - \
MAXALIGN(sizeof(ItemPointerData)))
-#define BTMaxItemSizeNoHeapTid(page) \
- MAXALIGN_DOWN((PageGetPageSize(page) - \
+#define BTMaxItemSizeNoHeapTid \
+ MAXALIGN_DOWN((BLCKSZ - \
MAXALIGN(SizeOfPageHeaderData + 3*sizeof(ItemIdData)) - \
MAXALIGN(sizeof(BTPageOpaqueData))) / 3)