@@ -164,12 +164,12 @@ typedef struct RumMetaPageData
164164 (RumItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \
165165 RumItemPointerGetBlockNumber(p) != InvalidBlockNumber)
166166
167- typedef struct RumKey
167+ typedef struct RumItem
168168{
169169 ItemPointerData iptr ;
170170 bool addInfoIsNull ;
171171 Datum addInfo ;
172- } RumKey ;
172+ } RumItem ;
173173
174174#define RumItemSetMin (item ) \
175175do { \
@@ -185,7 +185,7 @@ typedef struct
185185{
186186 /* We use BlockIdData not BlockNumber to avoid padding space wastage */
187187 BlockIdData child_blkno ;
188- RumKey key ;
188+ RumItem item ;
189189} PostingItem ;
190190
191191#define PostingItemGetBlockNumber (pointer ) \
@@ -262,21 +262,21 @@ typedef signed char RumNullCategory;
262262/*
263263 * Data (posting tree) pages
264264 */
265- #define RumDataPageGetRightBound (page ) ((RumKey *) PageGetContents(page))
265+ #define RumDataPageGetRightBound (page ) ((RumItem *) PageGetContents(page))
266266#define RumDataPageGetData (page ) \
267- (PageGetContents(page) + MAXALIGN(sizeof(RumKey )))
267+ (PageGetContents(page) + MAXALIGN(sizeof(RumItem )))
268268#define RumDataPageGetItem (page ,i ) \
269269 (RumDataPageGetData(page) + ((i)-1) * sizeof(PostingItem))
270270
271271#define RumDataPageGetFreeSpace (page ) \
272272 (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
273- - MAXALIGN(sizeof(RumKey )) /* right bound */ \
273+ - MAXALIGN(sizeof(RumItem )) /* right bound */ \
274274 - RumPageGetOpaque (page )-> maxoff * sizeof (PostingItem ) \
275275 - MAXALIGN (sizeof (RumPageOpaqueData )))
276276
277277#define RumMaxLeafDataItems \
278278 ((BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \
279- MAXALIGN(sizeof(RumKey )) /* right bound */ - \
279+ MAXALIGN(sizeof(RumItem )) /* right bound */ - \
280280 MAXALIGN (sizeof (RumPageOpaqueData ))) \
281281 / sizeof (ItemPointerData ))
282282
@@ -298,7 +298,7 @@ typedef struct
298298
299299#define RumDataPageSize \
300300 (BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
301- - MAXALIGN(sizeof(RumKey )) /* right bound */ \
301+ - MAXALIGN(sizeof(RumItem )) /* right bound */ \
302302 - MAXALIGN (sizeof (RumPageOpaqueData )) \
303303 - MAXALIGN (sizeof (RumDataLeafItemIndex ) * RumDataLeafIndexCount ))
304304
@@ -433,7 +433,7 @@ extern bool ruminsert(Relation index, Datum *values, bool *isnull,
433433 );
434434extern void rumEntryInsert (RumState * rumstate ,
435435 OffsetNumber attnum , Datum key , RumNullCategory category ,
436- RumKey * items , uint32 nitem , GinStatsData * buildStats );
436+ RumItem * items , uint32 nitem , GinStatsData * buildStats );
437437
438438/* rumbtree.c */
439439
@@ -483,7 +483,7 @@ typedef struct RumBtreeData
483483 bool isDelete ;
484484
485485 /* Data (posting tree) options */
486- RumKey * items ;
486+ RumItem * items ;
487487
488488 uint32 nitem ;
489489 uint32 curitem ;
@@ -509,25 +509,25 @@ extern void rumEntryFillRoot(RumBtree btree, Buffer root, Buffer lbuf, Buffer rb
509509 Page page , Page lpage , Page rpage );
510510extern IndexTuple rumPageGetLinkItup (RumBtree btree , Buffer buf , Page page );
511511extern void rumReadTuple (RumState * rumstate , OffsetNumber attnum ,
512- IndexTuple itup , RumKey * items );
512+ IndexTuple itup , RumItem * items );
513513extern void rumReadTuplePointers (RumState * rumstate , OffsetNumber attnum ,
514514 IndexTuple itup , ItemPointerData * ipd );
515515extern void updateItemIndexes (Page page , OffsetNumber attnum , RumState * rumstate );
516516extern void checkLeafDataPage (RumState * rumstate , AttrNumber attrnum , Page page );
517517
518518/* rumdatapage.c */
519519extern int rumCompareItemPointers (const ItemPointerData * a , const ItemPointerData * b );
520- extern int compareRumKey (RumState * state , const AttrNumber attno ,
521- const RumKey * a , const RumKey * b );
522- extern void convertIndexToKey (RumDataLeafItemIndex * src , RumKey * dst );
520+ extern int compareRumItem (RumState * state , const AttrNumber attno ,
521+ const RumItem * a , const RumItem * b );
522+ extern void convertIndexToKey (RumDataLeafItemIndex * src , RumItem * dst );
523523extern Pointer rumPlaceToDataPageLeaf (Pointer ptr , OffsetNumber attnum ,
524- RumKey * item , ItemPointer prev , RumState * rumstate );
524+ RumItem * item , ItemPointer prev , RumState * rumstate );
525525extern Size rumCheckPlaceToDataPageLeaf (OffsetNumber attnum ,
526- RumKey * item , ItemPointer prev , RumState * rumstate , Size size );
527- extern uint32 rumMergeItemPointers (RumState * rumstate , AttrNumber attno ,
528- RumKey * dst ,
529- RumKey * a , uint32 na ,
530- RumKey * b , uint32 nb );
526+ RumItem * item , ItemPointer prev , RumState * rumstate , Size size );
527+ extern uint32 rumMergeRumItems (RumState * rumstate , AttrNumber attno ,
528+ RumItem * dst ,
529+ RumItem * a , uint32 na ,
530+ RumItem * b , uint32 nb );
531531extern void RumDataPageAddItem (Page page , void * data , OffsetNumber offset );
532532extern void RumPageDeletePostingItem (Page page , OffsetNumber offset );
533533
@@ -544,9 +544,9 @@ extern RumPostingTreeScan *rumPrepareScanPostingTree(Relation index,
544544extern void rumInsertItemPointers (RumState * rumstate ,
545545 OffsetNumber attnum ,
546546 RumPostingTreeScan * gdi ,
547- RumKey * items , uint32 nitem ,
547+ RumItem * items , uint32 nitem ,
548548 GinStatsData * buildStats );
549- extern Buffer rumScanBeginPostingTree (RumPostingTreeScan * gdi , RumKey * key );
549+ extern Buffer rumScanBeginPostingTree (RumPostingTreeScan * gdi , RumItem * item );
550550extern void rumDataFillRoot (RumBtree btree , Buffer root , Buffer lbuf , Buffer rbuf ,
551551 Page page , Page lpage , Page rpage );
552552extern void rumPrepareDataScan (RumBtree btree , Relation index , OffsetNumber attnum , RumState * rumstate );
@@ -608,7 +608,7 @@ typedef struct RumScanKeyData
608608 * isFinished means that all the input entry streams are finished, so this
609609 * key cannot succeed for any later TIDs.
610610 */
611- RumKey curItem ;
611+ RumItem curItem ;
612612 bool curItemMatches ;
613613 bool recheckCurItem ;
614614 bool isFinished ;
@@ -636,20 +636,20 @@ typedef struct RumScanEntryData
636636 Buffer buffer ;
637637
638638 /* current ItemPointer to heap */
639- RumKey curRumKey ;
639+ RumItem curItem ;
640640
641641 /* for a partial-match or full-scan query, we accumulate all TIDs here */
642642 bool forceUseBitmap ;
643643 /* or here if we need to store addinfo */
644644 Tuplesortstate * matchSortstate ;
645- RumKey collectRumKey ;
645+ RumItem collectRumItem ;
646646
647647 /* for full-scan query with order-by */
648648 RumBtreeStack * stack ;
649649 bool scanWithAddInfo ;
650650
651651 /* used for Posting list and one page in Posting tree */
652- RumKey * list ;
652+ RumItem * list ;
653653 MemoryContext context ;
654654 int16 nlist ;
655655 int16 offset ;
@@ -663,7 +663,7 @@ typedef struct RumScanEntryData
663663
664664 /* Find by AddInfo */
665665 bool useMarkAddInfo ;
666- RumKey markAddInfo ;
666+ RumItem markAddInfo ;
667667} RumScanEntryData ;
668668
669669typedef struct
@@ -702,7 +702,7 @@ typedef struct RumScanOpaqueData
702702 int norderbys ; /* Number of columns in ordering.
703703 Will be assigned to sortstate->nKeys */
704704
705- RumKey key ;
705+ RumItem item ;
706706 bool firstCall ;
707707 bool isVoidRes ; /* true if query is unsatisfiable */
708708 bool willSort ;
@@ -746,7 +746,7 @@ typedef struct RumEntryAccumulator
746746 RumNullCategory category ;
747747 OffsetNumber attnum ;
748748 bool shouldSort ;
749- RumKey * list ;
749+ RumItem * list ;
750750 uint32 maxcount ; /* allocated size of list[] */
751751 uint32 count ; /* current number of list[] entries */
752752} RumEntryAccumulator ;
@@ -761,7 +761,7 @@ typedef struct
761761#if PG_VERSION_NUM >= 100000
762762 RBTreeIterator tree_walk ;
763763#endif
764- RumKey * sortSpace ;
764+ RumItem * sortSpace ;
765765 uint32 sortSpaceN ;
766766} BuildAccumulator ;
767767
@@ -771,7 +771,7 @@ extern void rumInsertBAEntries(BuildAccumulator *accum,
771771 Datum * entries , Datum * addInfo , bool * addInfoIsNull ,
772772 RumNullCategory * categories , int32 nentries );
773773extern void rumBeginBAScan (BuildAccumulator * accum );
774- extern RumKey * rumGetBAEntry (BuildAccumulator * accum ,
774+ extern RumItem * rumGetBAEntry (BuildAccumulator * accum ,
775775 OffsetNumber * attnum , Datum * key , RumNullCategory * category ,
776776 uint32 * n );
777777
@@ -873,7 +873,7 @@ rumDataPageLeafReadItemPointer(char *ptr, ItemPointer iptr, bool *addInfoIsNull)
873873 * passed in order to read the first item pointer.
874874 */
875875static inline Pointer
876- rumDataPageLeafRead (Pointer ptr , OffsetNumber attnum , RumKey * item ,
876+ rumDataPageLeafRead (Pointer ptr , OffsetNumber attnum , RumItem * item ,
877877 RumState * rumstate )
878878{
879879 Form_pg_attribute attr ;
@@ -954,7 +954,7 @@ rumDataPageLeafRead(Pointer ptr, OffsetNumber attnum, RumKey * item,
954954 * passed in order to read the first item pointer.
955955 */
956956static inline Pointer
957- rumDataPageLeafReadPointer (Pointer ptr , OffsetNumber attnum , RumKey * item ,
957+ rumDataPageLeafReadPointer (Pointer ptr , OffsetNumber attnum , RumItem * item ,
958958 RumState * rumstate )
959959{
960960 Form_pg_attribute attr ;
0 commit comments