Line data Source code
1 : /*-------------------------------------------------------------------------- 2 : * gin.h 3 : * Public header file for Generalized Inverted Index access method. 4 : * 5 : * Copyright (c) 2006-2024, PostgreSQL Global Development Group 6 : * 7 : * src/include/access/gin.h 8 : *-------------------------------------------------------------------------- 9 : */ 10 : #ifndef GIN_TUPLE_ 11 : #define GIN_TUPLE_ 12 : 13 : #include "access/ginblock.h" 14 : #include "storage/itemptr.h" 15 : #include "utils/sortsupport.h" 16 : 17 : /* 18 : * Data for one key in a GIN index. 19 : */ 20 : typedef struct GinTuple 21 : { 22 : int tuplen; /* length of the whole tuple */ 23 : OffsetNumber attrnum; /* attnum of index key */ 24 : uint16 keylen; /* bytes in data for key value */ 25 : int16 typlen; /* typlen for key */ 26 : bool typbyval; /* typbyval for key */ 27 : signed char category; /* category: normal or NULL? */ 28 : int nitems; /* number of TIDs in the data */ 29 : char data[FLEXIBLE_ARRAY_MEMBER]; 30 : } GinTuple; 31 : 32 : static inline ItemPointer 33 0 : GinTupleGetFirst(GinTuple *tup) 34 : { 35 : GinPostingList *list; 36 : 37 0 : list = (GinPostingList *) SHORTALIGN(tup->data + tup->keylen); 38 : 39 0 : return &list->first; 40 : } 41 : 42 : extern int _gin_compare_tuples(GinTuple *a, GinTuple *b, SortSupport ssup); 43 : 44 : #endif /* GIN_TUPLE_H */