PostgreSQL Source Code  git master
gin_private.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------
2  * gin_private.h
3  * header file for postgres inverted index access method implementation.
4  *
5  * Copyright (c) 2006-2024, PostgreSQL Global Development Group
6  *
7  * src/include/access/gin_private.h
8  *--------------------------------------------------------------------------
9  */
10 #ifndef GIN_PRIVATE_H
11 #define GIN_PRIVATE_H
12 
13 #include "access/amapi.h"
14 #include "access/gin.h"
15 #include "access/ginblock.h"
16 #include "access/itup.h"
17 #include "common/int.h"
18 #include "catalog/pg_am_d.h"
19 #include "fmgr.h"
20 #include "lib/rbtree.h"
21 #include "storage/bufmgr.h"
22 
23 /*
24  * Storage type for GIN's reloptions
25  */
26 typedef struct GinOptions
27 {
28  int32 vl_len_; /* varlena header (do not touch directly!) */
29  bool useFastUpdate; /* use fast updates? */
30  int pendingListCleanupSize; /* maximum size of pending list */
32 
33 #define GIN_DEFAULT_USE_FASTUPDATE true
34 #define GinGetUseFastUpdate(relation) \
35  (AssertMacro(relation->rd_rel->relkind == RELKIND_INDEX && \
36  relation->rd_rel->relam == GIN_AM_OID), \
37  (relation)->rd_options ? \
38  ((GinOptions *) (relation)->rd_options)->useFastUpdate : GIN_DEFAULT_USE_FASTUPDATE)
39 #define GinGetPendingListCleanupSize(relation) \
40  (AssertMacro(relation->rd_rel->relkind == RELKIND_INDEX && \
41  relation->rd_rel->relam == GIN_AM_OID), \
42  (relation)->rd_options && \
43  ((GinOptions *) (relation)->rd_options)->pendingListCleanupSize != -1 ? \
44  ((GinOptions *) (relation)->rd_options)->pendingListCleanupSize : \
45  gin_pending_list_limit)
46 
47 
48 /* Macros for buffer lock/unlock operations */
49 #define GIN_UNLOCK BUFFER_LOCK_UNLOCK
50 #define GIN_SHARE BUFFER_LOCK_SHARE
51 #define GIN_EXCLUSIVE BUFFER_LOCK_EXCLUSIVE
52 
53 
54 /*
55  * GinState: working data structure describing the index being worked on
56  */
57 typedef struct GinState
58 {
60  bool oneCol; /* true if single-column index */
61 
62  /*
63  * origTupdesc is the nominal tuple descriptor of the index, ie, the i'th
64  * attribute shows the key type (not the input data type!) of the i'th
65  * index column. In a single-column index this describes the actual leaf
66  * index tuples. In a multi-column index, the actual leaf tuples contain
67  * a smallint column number followed by a key datum of the appropriate
68  * type for that column. We set up tupdesc[i] to describe the actual
69  * rowtype of the index tuples for the i'th column, ie, (int2, keytype).
70  * Note that in any case, leaf tuples contain more data than is known to
71  * the TupleDesc; see access/gin/README for details.
72  */
75 
76  /*
77  * Per-index-column opclass support functions
78  */
84  FmgrInfo comparePartialFn[INDEX_MAX_KEYS]; /* optional method */
85  /* canPartialMatch[i] is true if comparePartialFn[i] is valid */
87  /* Collations to pass to the support functions */
90 
91 
92 /* ginutil.c */
93 extern bytea *ginoptions(Datum reloptions, bool validate);
96 extern void GinInitBuffer(Buffer b, uint32 f);
97 extern void GinInitPage(Page page, uint32 f, Size pageSize);
98 extern void GinInitMetabuffer(Buffer b);
99 extern int ginCompareEntries(GinState *ginstate, OffsetNumber attnum,
100  Datum a, GinNullCategory categorya,
101  Datum b, GinNullCategory categoryb);
102 extern int ginCompareAttEntries(GinState *ginstate,
103  OffsetNumber attnuma, Datum a, GinNullCategory categorya,
104  OffsetNumber attnumb, Datum b, GinNullCategory categoryb);
106  Datum value, bool isNull,
107  int32 *nentries, GinNullCategory **categories);
108 
109 extern OffsetNumber gintuple_get_attrnum(GinState *ginstate, IndexTuple tuple);
110 extern Datum gintuple_get_key(GinState *ginstate, IndexTuple tuple,
111  GinNullCategory *category);
112 
113 /* gininsert.c */
115  struct IndexInfo *indexInfo);
116 extern void ginbuildempty(Relation index);
117 extern bool gininsert(Relation index, Datum *values, bool *isnull,
118  ItemPointer ht_ctid, Relation heapRel,
119  IndexUniqueCheck checkUnique,
120  bool indexUnchanged,
121  struct IndexInfo *indexInfo);
122 extern void ginEntryInsert(GinState *ginstate,
124  ItemPointerData *items, uint32 nitem,
125  GinStatsData *buildStats);
126 
127 /* ginbtree.c */
128 
129 typedef struct GinBtreeStack
130 {
135  /* predictNumber contains predicted number of pages on current level */
139 
140 typedef struct GinBtreeData *GinBtree;
141 
142 /* Return codes for GinBtreeData.beginPlaceToPage method */
143 typedef enum
144 {
149 
150 typedef struct GinBtreeData
151 {
152  /* search methods */
157 
158  /* insert methods */
161  void (*execPlaceToPage) (GinBtree, Buffer, GinBtreeStack *, void *, BlockNumber, void *);
162  void *(*prepareDownlink) (GinBtree, Buffer);
164 
165  bool isData;
166 
169  GinState *ginstate; /* not valid in a data scan */
170  bool fullScan;
171  bool isBuild;
172 
173  /* Search key for Entry tree */
177 
178  /* Search key for data tree (posting tree) */
181 
182 /* This represents a tuple to be inserted to entry tree. */
183 typedef struct
184 {
185  IndexTuple entry; /* tuple to insert */
186  bool isDelete; /* delete old tuple at same offset? */
188 
189 /*
190  * This represents an itempointer, or many itempointers, to be inserted to
191  * a data (posting tree) leaf page
192  */
193 typedef struct
194 {
199 
200 /*
201  * For internal data (posting tree) pages, the insertion payload is a
202  * PostingItem
203  */
204 
205 extern GinBtreeStack *ginFindLeafPage(GinBtree btree, bool searchMode,
206  bool rootConflictCheck);
207 extern Buffer ginStepRight(Buffer buffer, Relation index, int lockmode);
208 extern void freeGinBtreeStack(GinBtreeStack *stack);
209 extern void ginInsertValue(GinBtree btree, GinBtreeStack *stack,
210  void *insertdata, GinStatsData *buildStats);
211 
212 /* ginentrypage.c */
213 extern IndexTuple GinFormTuple(GinState *ginstate,
215  Pointer data, Size dataSize, int nipd, bool errorTooBig);
217  Datum key, GinNullCategory category,
218  GinState *ginstate);
219 extern void ginEntryFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page lpage, BlockNumber rblkno, Page rpage);
221  IndexTuple itup, int *nitems);
222 
223 /* gindatapage.c */
224 extern ItemPointer GinDataLeafPageGetItems(Page page, int *nitems, ItemPointerData advancePast);
225 extern int GinDataLeafPageGetItemsToTbm(Page page, TIDBitmap *tbm);
227  ItemPointerData *items, uint32 nitems,
228  GinStatsData *buildStats, Buffer entrybuffer);
229 extern void GinDataPageAddPostingItem(Page page, PostingItem *data, OffsetNumber offset);
230 extern void GinPageDeletePostingItem(Page page, OffsetNumber offset);
231 extern void ginInsertItemPointers(Relation index, BlockNumber rootBlkno,
232  ItemPointerData *items, uint32 nitem,
233  GinStatsData *buildStats);
235 extern void ginDataFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page lpage, BlockNumber rblkno, Page rpage);
236 
237 /*
238  * This is declared in ginvacuum.c, but is passed between ginVacuumItemPointers
239  * and ginVacuumPostingTreeLeaf and as an opaque struct, so we need a forward
240  * declaration for it.
241  */
242 typedef struct GinVacuumState GinVacuumState;
243 
244 extern void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer,
245  GinVacuumState *gvs);
246 
247 /* ginscan.c */
248 
249 /*
250  * GinScanKeyData describes a single GIN index qualifier expression.
251  *
252  * From each qual expression, we extract one or more specific index search
253  * conditions, which are represented by GinScanEntryData. It's quite
254  * possible for identical search conditions to be requested by more than
255  * one qual expression, in which case we merge such conditions to have just
256  * one unique GinScanEntry --- this is particularly important for efficiency
257  * when dealing with full-index-scan entries. So there can be multiple
258  * GinScanKeyData.scanEntry pointers to the same GinScanEntryData.
259  *
260  * In each GinScanKeyData, nentries is the true number of entries, while
261  * nuserentries is the number that extractQueryFn returned (which is what
262  * we report to consistentFn). The "user" entries must come first.
263  */
264 typedef struct GinScanKeyData *GinScanKey;
265 
267 
268 typedef struct GinScanKeyData
269 {
270  /* Real number of entries in scanEntry[] (always > 0) */
272  /* Number of entries that extractQueryFn and consistentFn know about */
274 
275  /* array of GinScanEntry pointers, one per extracted search condition */
277 
278  /*
279  * At least one of the entries in requiredEntries must be present for a
280  * tuple to match the overall qual.
281  *
282  * additionalEntries contains entries that are needed by the consistent
283  * function to decide if an item matches, but are not sufficient to
284  * satisfy the qual without entries from requiredEntries.
285  */
290 
291  /* array of check flags, reported to consistentFn */
298 
299  /* other data needed for calling consistentFn */
301  /* NB: these three arrays have only nuserentries elements! */
308 
309  /*
310  * An excludeOnly scan key is not able to enumerate all matching tuples.
311  * That is, to be semantically correct on its own, it would need to have a
312  * GIN_CAT_EMPTY_QUERY scanEntry, but it doesn't. Such a key can still be
313  * used to filter tuples returned by other scan keys, so we will get the
314  * right answers as long as there's at least one non-excludeOnly scan key
315  * for each index attribute considered by the search. For efficiency
316  * reasons we don't want to have unnecessary GIN_CAT_EMPTY_QUERY entries,
317  * so we will convert an excludeOnly scan key to non-excludeOnly (by
318  * adding a GIN_CAT_EMPTY_QUERY scanEntry) only if there are no other
319  * non-excludeOnly scan keys.
320  */
322 
323  /*
324  * Match status data. curItem is the TID most recently tested (could be a
325  * lossy-page pointer). curItemMatches is true if it passes the
326  * consistentFn test; if so, recheckCurItem is the recheck flag.
327  * isFinished means that all the input entry streams are finished, so this
328  * key cannot succeed for any later TIDs.
329  */
335 
336 typedef struct GinScanEntryData
337 {
338  /* query key and other information from extractQueryFn */
346 
347  /* Current page in posting tree */
349 
350  /* current ItemPointer to heap */
352 
353  /* for a partial-match or full-scan query, we accumulate all TIDs here */
357 
358  /* used for Posting list and one page in Posting tree */
360  int nlist;
362 
368 
369 typedef struct GinScanOpaqueData
370 {
373 
374  GinScanKey keys; /* one per scan qualifier expr */
376 
377  GinScanEntry *entries; /* one per index search condition */
379  uint32 allocentries; /* allocated length of entries[] */
380 
381  MemoryContext keyCtx; /* used to hold key and entry data */
382 
383  bool isVoidRes; /* true if query is unsatisfiable */
385 
387 
388 extern IndexScanDesc ginbeginscan(Relation rel, int nkeys, int norderbys);
389 extern void ginendscan(IndexScanDesc scan);
390 extern void ginrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
391  ScanKey orderbys, int norderbys);
392 extern void ginNewScanKey(IndexScanDesc scan);
393 extern void ginFreeScanKeys(GinScanOpaque so);
394 
395 /* ginget.c */
396 extern int64 gingetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
397 
398 /* ginlogic.c */
399 extern void ginInitConsistentFunction(GinState *ginstate, GinScanKey key);
400 
401 /* ginvacuum.c */
403  IndexBulkDeleteResult *stats,
405  void *callback_state);
407  IndexBulkDeleteResult *stats);
409  ItemPointerData *items, int nitem, int *nremaining);
410 
411 /* ginvalidate.c */
412 extern bool ginvalidate(Oid opclassoid);
413 extern void ginadjustmembers(Oid opfamilyoid,
414  Oid opclassoid,
415  List *operators,
416  List *functions);
417 
418 /* ginbulk.c */
419 typedef struct GinEntryAccumulator
420 {
427  uint32 maxcount; /* allocated size of list[] */
428  uint32 count; /* current number of list[] entries */
430 
431 typedef struct
432 {
440 
441 extern void ginInitBA(BuildAccumulator *accum);
442 extern void ginInsertBAEntries(BuildAccumulator *accum,
444  Datum *entries, GinNullCategory *categories,
445  int32 nentries);
446 extern void ginBeginBAScan(BuildAccumulator *accum);
449  uint32 *n);
450 
451 /* ginfast.c */
452 
453 typedef struct GinTupleCollector
454 {
460 
461 extern void ginHeapTupleFastInsert(GinState *ginstate,
462  GinTupleCollector *collector);
463 extern void ginHeapTupleFastCollect(GinState *ginstate,
464  GinTupleCollector *collector,
465  OffsetNumber attnum, Datum value, bool isNull,
466  ItemPointer ht_ctid);
467 extern void ginInsertCleanup(GinState *ginstate, bool full_clean,
468  bool fill_fsm, bool forceCleanup, IndexBulkDeleteResult *stats);
469 
470 /* ginpostinglist.c */
471 
472 extern GinPostingList *ginCompressPostingList(const ItemPointer ipd, int nipd,
473  int maxsize, int *nwritten);
475 
477  int *ndecoded_out);
478 extern ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded_out);
480  ItemPointerData *b, uint32 nb,
481  int *nmerged);
482 
483 /*
484  * Merging the results of several gin scans compares item pointers a lot,
485  * so we want this to be inlined.
486  */
487 static inline int
489 {
490  uint64 ia = (uint64) GinItemPointerGetBlockNumber(a) << 32 | GinItemPointerGetOffsetNumber(a);
491  uint64 ib = (uint64) GinItemPointerGetBlockNumber(b) << 32 | GinItemPointerGetOffsetNumber(b);
492 
493  return pg_cmp_u64(ia, ib);
494 }
495 
496 extern int ginTraverseLock(Buffer buffer, bool searchMode);
497 
498 #endif /* GIN_PRIVATE_H */
uint32 BlockNumber
Definition: block.h:31
static Datum values[MAXATTR]
Definition: bootstrap.c:156
int Buffer
Definition: buf.h:23
Pointer Page
Definition: bufpage.h:78
unsigned int uint32
Definition: c.h:493
signed int int32
Definition: c.h:481
char * Pointer
Definition: c.h:470
unsigned char bool
Definition: c.h:443
size_t Size
Definition: c.h:592
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
Definition: genam.h:87
IndexUniqueCheck
Definition: genam.h:116
char GinTernaryValue
Definition: gin.h:58
int ginTraverseLock(Buffer buffer, bool searchMode)
Definition: ginbtree.c:39
IndexScanDesc ginbeginscan(Relation rel, int nkeys, int norderbys)
Definition: ginscan.c:25
struct GinScanKeyData GinScanKeyData
void freeGinBtreeStack(GinBtreeStack *stack)
Definition: ginbtree.c:198
ItemPointer ginPostingListDecodeAllSegments(GinPostingList *segment, int len, int *ndecoded_out)
void ginBeginBAScan(BuildAccumulator *accum)
Definition: ginbulk.c:257
void ginInsertValue(GinBtree btree, GinBtreeStack *stack, void *insertdata, GinStatsData *buildStats)
Definition: ginbtree.c:816
GinScanOpaqueData * GinScanOpaque
Definition: gin_private.h:386
void GinInitPage(Page page, uint32 f, Size pageSize)
Definition: ginutil.c:339
struct GinOptions GinOptions
int64 gingetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
Definition: ginget.c:1914
IndexBuildResult * ginbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
Definition: gininsert.c:320
void ginInsertCleanup(GinState *ginstate, bool full_clean, bool fill_fsm, bool forceCleanup, IndexBulkDeleteResult *stats)
Definition: ginfast.c:780
void ginHeapTupleFastCollect(GinState *ginstate, GinTupleCollector *collector, OffsetNumber attnum, Datum value, bool isNull, ItemPointer ht_ctid)
Definition: ginfast.c:483
void ginFreeScanKeys(GinScanOpaque so)
Definition: ginscan.c:233
GinBtreeStack * ginScanBeginPostingTree(GinBtree btree, Relation index, BlockNumber rootBlkno)
Definition: gindatapage.c:1936
IndexBulkDeleteResult * ginbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
Definition: ginvacuum.c:565
void ginEntryFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page lpage, BlockNumber rblkno, Page rpage)
Definition: ginentrypage.c:724
static int ginCompareItemPointers(ItemPointer a, ItemPointer b)
Definition: gin_private.h:488
Datum * ginExtractEntries(GinState *ginstate, OffsetNumber attnum, Datum value, bool isNull, int32 *nentries, GinNullCategory **categories)
Definition: ginutil.c:484
OffsetNumber gintuple_get_attrnum(GinState *ginstate, IndexTuple tuple)
Definition: ginutil.c:227
Buffer GinNewBuffer(Relation index)
Definition: ginutil.c:301
BlockNumber createPostingTree(Relation index, ItemPointerData *items, uint32 nitems, GinStatsData *buildStats, Buffer entrybuffer)
Definition: gindatapage.c:1775
GinPostingList * ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize, int *nwritten)
bool ginvalidate(Oid opclassoid)
Definition: ginvalidate.c:33
int ginPostingListDecodeAllSegmentsToTbm(GinPostingList *ptr, int len, TIDBitmap *tbm)
struct GinState GinState
void GinInitBuffer(Buffer b, uint32 f)
Definition: ginutil.c:351
void ginEntryInsert(GinState *ginstate, OffsetNumber attnum, Datum key, GinNullCategory category, ItemPointerData *items, uint32 nitem, GinStatsData *buildStats)
Definition: gininsert.c:179
void ginendscan(IndexScanDesc scan)
Definition: ginscan.c:458
void ginNewScanKey(IndexScanDesc scan)
Definition: ginscan.c:263
void ginInsertBAEntries(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum *entries, GinNullCategory *categories, int32 nentries)
Definition: ginbulk.c:210
struct GinScanOpaqueData GinScanOpaqueData
void ginrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys)
Definition: ginscan.c:442
void GinPageDeletePostingItem(Page page, OffsetNumber offset)
Definition: gindatapage.c:417
ItemPointer ginVacuumItemPointers(GinVacuumState *gvs, ItemPointerData *items, int nitem, int *nremaining)
Definition: ginvacuum.c:48
void ginInitConsistentFunction(GinState *ginstate, GinScanKey key)
Definition: ginlogic.c:223
GinPlaceToPageRC
Definition: gin_private.h:144
@ GPTP_INSERT
Definition: gin_private.h:146
@ GPTP_SPLIT
Definition: gin_private.h:147
@ GPTP_NO_WORK
Definition: gin_private.h:145
struct GinScanEntryData * GinScanEntry
Definition: gin_private.h:266
bool gininsert(Relation index, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, struct IndexInfo *indexInfo)
Definition: gininsert.c:486
struct GinBtreeStack GinBtreeStack
ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded_out)
int ginCompareAttEntries(GinState *ginstate, OffsetNumber attnuma, Datum a, GinNullCategory categorya, OffsetNumber attnumb, Datum b, GinNullCategory categoryb)
Definition: ginutil.c:411
int GinDataLeafPageGetItemsToTbm(Page page, TIDBitmap *tbm)
Definition: gindatapage.c:182
struct GinBtreeData GinBtreeData
Datum gintuple_get_key(GinState *ginstate, IndexTuple tuple, GinNullCategory *category)
Definition: ginutil.c:260
struct GinBtreeData * GinBtree
Definition: gin_private.h:140
void GinDataPageAddPostingItem(Page page, PostingItem *data, OffsetNumber offset)
Definition: gindatapage.c:380
void ginInsertItemPointers(Relation index, BlockNumber rootBlkno, ItemPointerData *items, uint32 nitem, GinStatsData *buildStats)
Definition: gindatapage.c:1908
IndexBulkDeleteResult * ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
Definition: ginvacuum.c:688
void GinInitMetabuffer(Buffer b)
Definition: ginutil.c:357
void ginInitBA(BuildAccumulator *accum)
Definition: ginbulk.c:109
void ginbuildempty(Relation index)
Definition: gininsert.c:437
void ginHeapTupleFastInsert(GinState *ginstate, GinTupleCollector *collector)
Definition: ginfast.c:219
void initGinState(GinState *state, Relation index)
Definition: ginutil.c:98
bytea * ginoptions(Datum reloptions, bool validate)
Definition: ginutil.c:603
struct GinScanKeyData * GinScanKey
Definition: gin_private.h:264
ItemPointer ginReadTuple(GinState *ginstate, OffsetNumber attnum, IndexTuple itup, int *nitems)
Definition: ginentrypage.c:163
struct GinEntryAccumulator GinEntryAccumulator
ItemPointerData * ginGetBAEntry(BuildAccumulator *accum, OffsetNumber *attnum, Datum *key, GinNullCategory *category, uint32 *n)
Definition: ginbulk.c:268
int ginCompareEntries(GinState *ginstate, OffsetNumber attnum, Datum a, GinNullCategory categorya, Datum b, GinNullCategory categoryb)
Definition: ginutil.c:389
void ginadjustmembers(Oid opfamilyoid, Oid opclassoid, List *operators, List *functions)
Definition: ginvalidate.c:279
void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer, GinVacuumState *gvs)
Definition: gindatapage.c:738
IndexTuple GinFormTuple(GinState *ginstate, OffsetNumber attnum, Datum key, GinNullCategory category, Pointer data, Size dataSize, int nipd, bool errorTooBig)
Definition: ginentrypage.c:45
void ginPrepareEntryScan(GinBtree btree, OffsetNumber attnum, Datum key, GinNullCategory category, GinState *ginstate)
Definition: ginentrypage.c:748
struct GinTupleCollector GinTupleCollector
ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na, ItemPointerData *b, uint32 nb, int *nmerged)
void ginDataFillRoot(GinBtree btree, Page root, BlockNumber lblkno, Page lpage, BlockNumber rblkno, Page rpage)
Definition: gindatapage.c:1349
Buffer ginStepRight(Buffer buffer, Relation index, int lockmode)
Definition: ginbtree.c:177
GinBtreeStack * ginFindLeafPage(GinBtree btree, bool searchMode, bool rootConflictCheck)
Definition: ginbtree.c:83
ItemPointer GinDataLeafPageGetItems(Page page, int *nitems, ItemPointerData advancePast)
Definition: gindatapage.c:135
struct GinScanEntryData GinScanEntryData
#define GinItemPointerGetOffsetNumber(pointer)
Definition: ginblock.h:146
signed char GinNullCategory
Definition: ginblock.h:206
#define GinItemPointerGetBlockNumber(pointer)
Definition: ginblock.h:143
#define nitems(x)
Definition: indent.h:31
static struct @149 value
static int pg_cmp_u64(uint64 a, uint64 b)
Definition: int.h:501
int b
Definition: isn.c:70
int a
Definition: isn.c:69
uint16 OffsetNumber
Definition: off.h:24
int16 attnum
Definition: pg_attribute.h:74
#define INDEX_MAX_KEYS
const void size_t len
const void * data
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
static const struct fns functions
Definition: regcomp.c:356
uint16 StrategyNumber
Definition: stratnum.h:22
GinState * ginstate
Definition: gin_private.h:433
RBTreeIterator tree_walk
Definition: gin_private.h:438
GinEntryAccumulator * entryallocator
Definition: gin_private.h:435
Definition: fmgr.h:57
ItemPointerData * items
Definition: gin_private.h:195
Datum entryKey
Definition: gin_private.h:175
BlockNumber(* findChildPage)(GinBtree, GinBtreeStack *)
Definition: gin_private.h:153
GinState * ginstate
Definition: gin_private.h:169
void(* execPlaceToPage)(GinBtree, Buffer, GinBtreeStack *, void *, BlockNumber, void *)
Definition: gin_private.h:161
BlockNumber(* getLeftMostChild)(GinBtree, Page)
Definition: gin_private.h:154
bool(* findItem)(GinBtree, GinBtreeStack *)
Definition: gin_private.h:156
bool(* isMoveRight)(GinBtree, Page)
Definition: gin_private.h:155
ItemPointerData itemptr
Definition: gin_private.h:179
GinPlaceToPageRC(* beginPlaceToPage)(GinBtree, Buffer, GinBtreeStack *, void *, BlockNumber, void **, Page *, Page *)
Definition: gin_private.h:160
GinNullCategory entryCategory
Definition: gin_private.h:176
OffsetNumber entryAttnum
Definition: gin_private.h:174
OffsetNumber(* findChildPtr)(GinBtree, Page, BlockNumber, OffsetNumber)
Definition: gin_private.h:159
Relation index
Definition: gin_private.h:167
void(* fillRoot)(GinBtree, Page, BlockNumber, Page, BlockNumber, Page)
Definition: gin_private.h:163
BlockNumber rootBlkno
Definition: gin_private.h:168
OffsetNumber off
Definition: gin_private.h:133
uint32 predictNumber
Definition: gin_private.h:136
ItemPointerData iptr
Definition: gin_private.h:134
struct GinBtreeStack * parent
Definition: gin_private.h:137
BlockNumber blkno
Definition: gin_private.h:131
OffsetNumber attnum
Definition: gin_private.h:424
ItemPointerData * list
Definition: gin_private.h:426
GinNullCategory category
Definition: gin_private.h:423
int32 vl_len_
Definition: gin_private.h:28
bool useFastUpdate
Definition: gin_private.h:29
int pendingListCleanupSize
Definition: gin_private.h:30
ItemPointerData curItem
Definition: gin_private.h:351
TBMIterateResult * matchResult
Definition: gin_private.h:356
GinBtreeData btree
Definition: gin_private.h:366
TIDBitmap * matchBitmap
Definition: gin_private.h:354
ItemPointerData * list
Definition: gin_private.h:359
GinNullCategory queryCategory
Definition: gin_private.h:340
TBMIterator * matchIterator
Definition: gin_private.h:355
StrategyNumber strategy
Definition: gin_private.h:343
Pointer extra_data
Definition: gin_private.h:342
OffsetNumber offset
Definition: gin_private.h:361
uint32 predictNumberResult
Definition: gin_private.h:365
OffsetNumber attnum
Definition: gin_private.h:345
GinScanEntry * scanEntry
Definition: gin_private.h:276
uint32 nuserentries
Definition: gin_private.h:273
StrategyNumber strategy
Definition: gin_private.h:305
GinScanEntry * additionalEntries
Definition: gin_private.h:288
Datum * queryValues
Definition: gin_private.h:302
GinScanEntry * requiredEntries
Definition: gin_private.h:286
FmgrInfo * triConsistentFmgrInfo
Definition: gin_private.h:296
ItemPointerData curItem
Definition: gin_private.h:330
GinNullCategory * queryCategories
Definition: gin_private.h:303
FmgrInfo * consistentFmgrInfo
Definition: gin_private.h:295
GinTernaryValue * entryRes
Definition: gin_private.h:292
Pointer * extra_data
Definition: gin_private.h:304
GinTernaryValue(* triConsistentFn)(GinScanKey key)
Definition: gin_private.h:294
bool(* boolConsistentFn)(GinScanKey key)
Definition: gin_private.h:293
OffsetNumber attnum
Definition: gin_private.h:307
GinScanKey keys
Definition: gin_private.h:374
MemoryContext keyCtx
Definition: gin_private.h:381
GinScanEntry * entries
Definition: gin_private.h:377
MemoryContext tempCtx
Definition: gin_private.h:371
FmgrInfo comparePartialFn[INDEX_MAX_KEYS]
Definition: gin_private.h:84
bool oneCol
Definition: gin_private.h:60
FmgrInfo extractQueryFn[INDEX_MAX_KEYS]
Definition: gin_private.h:81
TupleDesc tupdesc[INDEX_MAX_KEYS]
Definition: gin_private.h:74
FmgrInfo triConsistentFn[INDEX_MAX_KEYS]
Definition: gin_private.h:83
TupleDesc origTupdesc
Definition: gin_private.h:73
FmgrInfo extractValueFn[INDEX_MAX_KEYS]
Definition: gin_private.h:80
Relation index
Definition: gin_private.h:59
FmgrInfo consistentFn[INDEX_MAX_KEYS]
Definition: gin_private.h:82
Oid supportCollation[INDEX_MAX_KEYS]
Definition: gin_private.h:88
bool canPartialMatch[INDEX_MAX_KEYS]
Definition: gin_private.h:86
FmgrInfo compareFn[INDEX_MAX_KEYS]
Definition: gin_private.h:79
IndexTuple * tuples
Definition: gin_private.h:455
Definition: pg_list.h:54
Definition: rbtree.h:24
Definition: rbtree.c:42
Definition: type.h:95
Definition: regguts.h:323
Definition: c.h:674
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:46