@@ -164,12 +164,12 @@ typedef struct RumMetaPageData
164
164
(RumItemPointerGetOffsetNumber(p) == (OffsetNumber)0xffff && \
165
165
RumItemPointerGetBlockNumber(p) != InvalidBlockNumber)
166
166
167
- typedef struct RumKey
167
+ typedef struct RumItem
168
168
{
169
169
ItemPointerData iptr ;
170
170
bool addInfoIsNull ;
171
171
Datum addInfo ;
172
- }RumKey ;
172
+ }RumItem ;
173
173
174
174
#define RumItemSetMin (item ) \
175
175
do { \
@@ -185,7 +185,7 @@ typedef struct
185
185
{
186
186
/* We use BlockIdData not BlockNumber to avoid padding space wastage */
187
187
BlockIdData child_blkno ;
188
- RumKey key ;
188
+ RumItem item ;
189
189
}PostingItem ;
190
190
191
191
#define PostingItemGetBlockNumber (pointer ) \
@@ -262,21 +262,21 @@ typedef signed char RumNullCategory;
262
262
/*
263
263
* Data (posting tree) pages
264
264
*/
265
- #define RumDataPageGetRightBound (page )((RumKey *) PageGetContents(page))
265
+ #define RumDataPageGetRightBound (page )((RumItem *) PageGetContents(page))
266
266
#define RumDataPageGetData (page )\
267
- (PageGetContents(page) + MAXALIGN(sizeof(RumKey )))
267
+ (PageGetContents(page) + MAXALIGN(sizeof(RumItem )))
268
268
#define RumDataPageGetItem (page ,i )\
269
269
(RumDataPageGetData(page) + ((i)-1) * sizeof(PostingItem))
270
270
271
271
#define RumDataPageGetFreeSpace (page )\
272
272
(BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
273
- - MAXALIGN(sizeof(RumKey ))/* right bound */ \
273
+ - MAXALIGN(sizeof(RumItem ))/* right bound */ \
274
274
- RumPageGetOpaque (page )-> maxoff * sizeof (PostingItem ) \
275
275
- MAXALIGN (sizeof (RumPageOpaqueData )))
276
276
277
277
#define RumMaxLeafDataItems \
278
278
((BLCKSZ - MAXALIGN(SizeOfPageHeaderData) - \
279
- MAXALIGN(sizeof(RumKey ))/* right bound */ - \
279
+ MAXALIGN(sizeof(RumItem ))/* right bound */ - \
280
280
MAXALIGN (sizeof (RumPageOpaqueData ))) \
281
281
/sizeof (ItemPointerData ))
282
282
@@ -298,7 +298,7 @@ typedef struct
298
298
299
299
#define RumDataPageSize \
300
300
(BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
301
- - MAXALIGN(sizeof(RumKey ))/* right bound */ \
301
+ - MAXALIGN(sizeof(RumItem ))/* right bound */ \
302
302
- MAXALIGN (sizeof (RumPageOpaqueData )) \
303
303
- MAXALIGN (sizeof (RumDataLeafItemIndex )* RumDataLeafIndexCount ))
304
304
@@ -433,7 +433,7 @@ extern bool ruminsert(Relation index, Datum *values, bool *isnull,
433
433
);
434
434
extern void rumEntryInsert (RumState * rumstate ,
435
435
OffsetNumber attnum ,Datum key ,RumNullCategory category ,
436
- RumKey * items ,uint32 nitem ,GinStatsData * buildStats );
436
+ RumItem * items ,uint32 nitem ,GinStatsData * buildStats );
437
437
438
438
/* rumbtree.c */
439
439
@@ -483,7 +483,7 @@ typedef struct RumBtreeData
483
483
bool isDelete ;
484
484
485
485
/* Data (posting tree) options */
486
- RumKey * items ;
486
+ RumItem * items ;
487
487
488
488
uint32 nitem ;
489
489
uint32 curitem ;
@@ -509,25 +509,25 @@ extern void rumEntryFillRoot(RumBtree btree, Buffer root, Buffer lbuf, Buffer rb
509
509
Page page ,Page lpage ,Page rpage );
510
510
extern IndexTuple rumPageGetLinkItup (RumBtree btree ,Buffer buf ,Page page );
511
511
extern void rumReadTuple (RumState * rumstate ,OffsetNumber attnum ,
512
- IndexTuple itup ,RumKey * items );
512
+ IndexTuple itup ,RumItem * items );
513
513
extern void rumReadTuplePointers (RumState * rumstate ,OffsetNumber attnum ,
514
514
IndexTuple itup ,ItemPointerData * ipd );
515
515
extern void updateItemIndexes (Page page ,OffsetNumber attnum ,RumState * rumstate );
516
516
extern void checkLeafDataPage (RumState * rumstate ,AttrNumber attrnum ,Page page );
517
517
518
518
/* rumdatapage.c */
519
519
extern 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 );
523
523
extern Pointer rumPlaceToDataPageLeaf (Pointer ptr ,OffsetNumber attnum ,
524
- RumKey * item ,ItemPointer prev ,RumState * rumstate );
524
+ RumItem * item ,ItemPointer prev ,RumState * rumstate );
525
525
extern 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 );
531
531
extern void RumDataPageAddItem (Page page ,void * data ,OffsetNumber offset );
532
532
extern void RumPageDeletePostingItem (Page page ,OffsetNumber offset );
533
533
@@ -544,9 +544,9 @@ extern RumPostingTreeScan *rumPrepareScanPostingTree(Relation index,
544
544
extern void rumInsertItemPointers (RumState * rumstate ,
545
545
OffsetNumber attnum ,
546
546
RumPostingTreeScan * gdi ,
547
- RumKey * items ,uint32 nitem ,
547
+ RumItem * items ,uint32 nitem ,
548
548
GinStatsData * buildStats );
549
- extern Buffer rumScanBeginPostingTree (RumPostingTreeScan * gdi ,RumKey * key );
549
+ extern Buffer rumScanBeginPostingTree (RumPostingTreeScan * gdi ,RumItem * item );
550
550
extern void rumDataFillRoot (RumBtree btree ,Buffer root ,Buffer lbuf ,Buffer rbuf ,
551
551
Page page ,Page lpage ,Page rpage );
552
552
extern void rumPrepareDataScan (RumBtree btree ,Relation index ,OffsetNumber attnum ,RumState * rumstate );
@@ -608,7 +608,7 @@ typedef struct RumScanKeyData
608
608
* isFinished means that all the input entry streams are finished, so this
609
609
* key cannot succeed for any later TIDs.
610
610
*/
611
- RumKey curItem ;
611
+ RumItem curItem ;
612
612
bool curItemMatches ;
613
613
bool recheckCurItem ;
614
614
bool isFinished ;
@@ -636,20 +636,20 @@ typedef struct RumScanEntryData
636
636
Buffer buffer ;
637
637
638
638
/* current ItemPointer to heap */
639
- RumKey curRumKey ;
639
+ RumItem curItem ;
640
640
641
641
/* for a partial-match or full-scan query, we accumulate all TIDs here */
642
642
bool forceUseBitmap ;
643
643
/* or here if we need to store addinfo */
644
644
Tuplesortstate * matchSortstate ;
645
- RumKey collectRumKey ;
645
+ RumItem collectRumItem ;
646
646
647
647
/* for full-scan query with order-by */
648
648
RumBtreeStack * stack ;
649
649
bool scanWithAddInfo ;
650
650
651
651
/* used for Posting list and one page in Posting tree */
652
- RumKey * list ;
652
+ RumItem * list ;
653
653
MemoryContext context ;
654
654
int16 nlist ;
655
655
int16 offset ;
@@ -663,7 +663,7 @@ typedef struct RumScanEntryData
663
663
664
664
/* Find by AddInfo */
665
665
bool useMarkAddInfo ;
666
- RumKey markAddInfo ;
666
+ RumItem markAddInfo ;
667
667
}RumScanEntryData ;
668
668
669
669
typedef struct
@@ -702,7 +702,7 @@ typedef struct RumScanOpaqueData
702
702
int norderbys ;/* Number of columns in ordering.
703
703
Will be assigned to sortstate->nKeys */
704
704
705
- RumKey key ;
705
+ RumItem item ;
706
706
bool firstCall ;
707
707
bool isVoidRes ;/* true if query is unsatisfiable */
708
708
bool willSort ;
@@ -746,7 +746,7 @@ typedef struct RumEntryAccumulator
746
746
RumNullCategory category ;
747
747
OffsetNumber attnum ;
748
748
bool shouldSort ;
749
- RumKey * list ;
749
+ RumItem * list ;
750
750
uint32 maxcount ;/* allocated size of list[] */
751
751
uint32 count ;/* current number of list[] entries */
752
752
}RumEntryAccumulator ;
@@ -761,7 +761,7 @@ typedef struct
761
761
#if PG_VERSION_NUM >=100000
762
762
RBTreeIterator tree_walk ;
763
763
#endif
764
- RumKey * sortSpace ;
764
+ RumItem * sortSpace ;
765
765
uint32 sortSpaceN ;
766
766
}BuildAccumulator ;
767
767
@@ -771,7 +771,7 @@ extern void rumInsertBAEntries(BuildAccumulator *accum,
771
771
Datum * entries ,Datum * addInfo ,bool * addInfoIsNull ,
772
772
RumNullCategory * categories ,int32 nentries );
773
773
extern void rumBeginBAScan (BuildAccumulator * accum );
774
- extern RumKey * rumGetBAEntry (BuildAccumulator * accum ,
774
+ extern RumItem * rumGetBAEntry (BuildAccumulator * accum ,
775
775
OffsetNumber * attnum ,Datum * key ,RumNullCategory * category ,
776
776
uint32 * n );
777
777
@@ -873,7 +873,7 @@ rumDataPageLeafReadItemPointer(char *ptr, ItemPointer iptr, bool *addInfoIsNull)
873
873
* passed in order to read the first item pointer.
874
874
*/
875
875
static inline Pointer
876
- rumDataPageLeafRead (Pointer ptr ,OffsetNumber attnum ,RumKey * item ,
876
+ rumDataPageLeafRead (Pointer ptr ,OffsetNumber attnum ,RumItem * item ,
877
877
RumState * rumstate )
878
878
{
879
879
Form_pg_attribute attr ;
@@ -954,7 +954,7 @@ rumDataPageLeafRead(Pointer ptr, OffsetNumber attnum, RumKey * item,
954
954
* passed in order to read the first item pointer.
955
955
*/
956
956
static inline Pointer
957
- rumDataPageLeafReadPointer (Pointer ptr ,OffsetNumber attnum ,RumKey * item ,
957
+ rumDataPageLeafReadPointer (Pointer ptr ,OffsetNumber attnum ,RumItem * item ,
958
958
RumState * rumstate )
959
959
{
960
960
Form_pg_attribute attr ;