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