]> granicus.if.org Git - postgresql/blob - src/include/access/gist_private.h
Allow index AMs to cache data across aminsert calls within a SQL command.
[postgresql] / src / include / access / gist_private.h
1 /*-------------------------------------------------------------------------
2  *
3  * gist_private.h
4  *        private declarations for GiST -- declarations related to the
5  *        internal implementation of GiST, not the public API
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/gist_private.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef GIST_PRIVATE_H
15 #define GIST_PRIVATE_H
16
17 #include "access/amapi.h"
18 #include "access/gist.h"
19 #include "access/itup.h"
20 #include "access/xlogreader.h"
21 #include "fmgr.h"
22 #include "lib/pairingheap.h"
23 #include "storage/bufmgr.h"
24 #include "storage/buffile.h"
25 #include "utils/hsearch.h"
26 #include "access/genam.h"
27
28 /*
29  * Maximum number of "halves" a page can be split into in one operation.
30  * Typically a split produces 2 halves, but can be more if keys have very
31  * different lengths, or when inserting multiple keys in one operation (as
32  * when inserting downlinks to an internal node).  There is no theoretical
33  * limit on this, but in practice if you get more than a handful page halves
34  * in one split, there's something wrong with the opclass implementation.
35  * GIST_MAX_SPLIT_PAGES is an arbitrary limit on that, used to size some
36  * local arrays used during split.  Note that there is also a limit on the
37  * number of buffers that can be held locked at a time, MAX_SIMUL_LWLOCKS,
38  * so if you raise this higher than that limit, you'll just get a different
39  * error.
40  */
41 #define GIST_MAX_SPLIT_PAGES            75
42
43 /* Buffer lock modes */
44 #define GIST_SHARE      BUFFER_LOCK_SHARE
45 #define GIST_EXCLUSIVE  BUFFER_LOCK_EXCLUSIVE
46 #define GIST_UNLOCK BUFFER_LOCK_UNLOCK
47
48 typedef struct
49 {
50         BlockNumber prev;
51         uint32          freespace;
52         char            tupledata[FLEXIBLE_ARRAY_MEMBER];
53 } GISTNodeBufferPage;
54
55 #define BUFFER_PAGE_DATA_OFFSET MAXALIGN(offsetof(GISTNodeBufferPage, tupledata))
56 /* Returns free space in node buffer page */
57 #define PAGE_FREE_SPACE(nbp) (nbp->freespace)
58 /* Checks if node buffer page is empty */
59 #define PAGE_IS_EMPTY(nbp) (nbp->freespace == BLCKSZ - BUFFER_PAGE_DATA_OFFSET)
60 /* Checks if node buffers page don't contain sufficient space for index tuple */
61 #define PAGE_NO_SPACE(nbp, itup) (PAGE_FREE_SPACE(nbp) < \
62                                                                                 MAXALIGN(IndexTupleSize(itup)))
63
64 /*
65  * GISTSTATE: information needed for any GiST index operation
66  *
67  * This struct retains call info for the index's opclass-specific support
68  * functions (per index column), plus the index's tuple descriptor.
69  *
70  * scanCxt holds the GISTSTATE itself as well as any data that lives for the
71  * lifetime of the index operation.  We pass this to the support functions
72  * via fn_mcxt, so that they can store scan-lifespan data in it.  The
73  * functions are invoked in tempCxt, which is typically short-lifespan
74  * (that is, it's reset after each tuple).  However, tempCxt can be the same
75  * as scanCxt if we're not bothering with per-tuple context resets.
76  */
77 typedef struct GISTSTATE
78 {
79         MemoryContext scanCxt;          /* context for scan-lifespan data */
80         MemoryContext tempCxt;          /* short-term context for calling functions */
81
82         TupleDesc       tupdesc;                /* index's tuple descriptor */
83         TupleDesc       fetchTupdesc;   /* tuple descriptor for tuples returned in an
84                                                                  * index-only scan */
85
86         FmgrInfo        consistentFn[INDEX_MAX_KEYS];
87         FmgrInfo        unionFn[INDEX_MAX_KEYS];
88         FmgrInfo        compressFn[INDEX_MAX_KEYS];
89         FmgrInfo        decompressFn[INDEX_MAX_KEYS];
90         FmgrInfo        penaltyFn[INDEX_MAX_KEYS];
91         FmgrInfo        picksplitFn[INDEX_MAX_KEYS];
92         FmgrInfo        equalFn[INDEX_MAX_KEYS];
93         FmgrInfo        distanceFn[INDEX_MAX_KEYS];
94         FmgrInfo        fetchFn[INDEX_MAX_KEYS];
95
96         /* Collations to pass to the support functions */
97         Oid                     supportCollation[INDEX_MAX_KEYS];
98 } GISTSTATE;
99
100
101 /*
102  * During a GiST index search, we must maintain a queue of unvisited items,
103  * which can be either individual heap tuples or whole index pages.  If it
104  * is an ordered search, the unvisited items should be visited in distance
105  * order.  Unvisited items at the same distance should be visited in
106  * depth-first order, that is heap items first, then lower index pages, then
107  * upper index pages; this rule avoids doing extra work during a search that
108  * ends early due to LIMIT.
109  *
110  * To perform an ordered search, we use a pairing heap to manage the
111  * distance-order queue.  In a non-ordered search (no order-by operators),
112  * we use it to return heap tuples before unvisited index pages, to
113  * ensure depth-first order, but all entries are otherwise considered
114  * equal.
115  */
116
117 /* Individual heap tuple to be visited */
118 typedef struct GISTSearchHeapItem
119 {
120         ItemPointerData heapPtr;
121         bool            recheck;                /* T if quals must be rechecked */
122         bool            recheckDistances;               /* T if distances must be rechecked */
123         IndexTuple      ftup;                   /* data fetched back from the index, used in
124                                                                  * index-only scans */
125         OffsetNumber offnum;            /* track offset in page to mark tuple as
126                                                                  * LP_DEAD */
127 } GISTSearchHeapItem;
128
129 /* Unvisited item, either index page or heap tuple */
130 typedef struct GISTSearchItem
131 {
132         pairingheap_node phNode;
133         BlockNumber blkno;                      /* index page number, or InvalidBlockNumber */
134         union
135         {
136                 GistNSN         parentlsn;      /* parent page's LSN, if index page */
137                 /* we must store parentlsn to detect whether a split occurred */
138                 GISTSearchHeapItem heap;        /* heap info, if heap tuple */
139         }                       data;
140         double          distances[FLEXIBLE_ARRAY_MEMBER];               /* numberOfOrderBys
141                                                                                                                  * entries */
142 } GISTSearchItem;
143
144 #define GISTSearchItemIsHeap(item)      ((item).blkno == InvalidBlockNumber)
145
146 #define SizeOfGISTSearchItem(n_distances) (offsetof(GISTSearchItem, distances) + sizeof(double) * (n_distances))
147
148 /*
149  * GISTScanOpaqueData: private state for a scan of a GiST index
150  */
151 typedef struct GISTScanOpaqueData
152 {
153         GISTSTATE  *giststate;          /* index information, see above */
154         Oid                *orderByTypes;       /* datatypes of ORDER BY expressions */
155
156         pairingheap *queue;                     /* queue of unvisited items */
157         MemoryContext queueCxt;         /* context holding the queue */
158         bool            qual_ok;                /* false if qual can never be satisfied */
159         bool            firstCall;              /* true until first gistgettuple call */
160
161         /* pre-allocated workspace arrays */
162         double     *distances;          /* output area for gistindex_keytest */
163
164         /* info about killed items if any (killedItems is NULL if never used) */
165         OffsetNumber *killedItems;      /* offset numbers of killed items */
166         int                     numKilled;              /* number of currently stored items */
167         BlockNumber curBlkno;           /* current number of block */
168         GistNSN         curPageLSN;             /* pos in the WAL stream when page was read */
169
170         /* In a non-ordered search, returnable heap items are stored here: */
171         GISTSearchHeapItem pageData[BLCKSZ / sizeof(IndexTupleData)];
172         OffsetNumber nPageData;         /* number of valid items in array */
173         OffsetNumber curPageData;       /* next item to return */
174         MemoryContext pageDataCxt;      /* context holding the fetched tuples, for
175                                                                  * index-only scans */
176 } GISTScanOpaqueData;
177
178 typedef GISTScanOpaqueData *GISTScanOpaque;
179
180
181 /* XLog stuff */
182
183 #define XLOG_GIST_PAGE_UPDATE           0x00
184  /* #define XLOG_GIST_NEW_ROOT                   0x20 */        /* not used anymore */
185 #define XLOG_GIST_PAGE_SPLIT            0x30
186  /* #define XLOG_GIST_INSERT_COMPLETE    0x40 */        /* not used anymore */
187 #define XLOG_GIST_CREATE_INDEX          0x50
188  /* #define XLOG_GIST_PAGE_DELETE                0x60 */        /* not used anymore */
189
190 /*
191  * Backup Blk 0: updated page.
192  * Backup Blk 1: If this operation completes a page split, by inserting a
193  *                               downlink for the split page, the left half of the split
194  */
195 typedef struct gistxlogPageUpdate
196 {
197         /* number of deleted offsets */
198         uint16          ntodelete;
199         uint16          ntoinsert;
200
201         /*
202          * In payload of blk 0 : 1. todelete OffsetNumbers 2. tuples to insert
203          */
204 } gistxlogPageUpdate;
205
206 /*
207  * Backup Blk 0: If this operation completes a page split, by inserting a
208  *                               downlink for the split page, the left half of the split
209  * Backup Blk 1 - npage: split pages (1 is the original page)
210  */
211 typedef struct gistxlogPageSplit
212 {
213         BlockNumber origrlink;          /* rightlink of the page before split */
214         GistNSN         orignsn;                /* NSN of the page before split */
215         bool            origleaf;               /* was splitted page a leaf page? */
216
217         uint16          npage;                  /* # of pages in the split */
218         bool            markfollowright;        /* set F_FOLLOW_RIGHT flags */
219
220         /*
221          * follow: 1. gistxlogPage and array of IndexTupleData per page
222          */
223 } gistxlogPageSplit;
224
225 typedef struct gistxlogPage
226 {
227         BlockNumber blkno;
228         int                     num;                    /* number of index tuples following */
229 } gistxlogPage;
230
231 /* SplitedPageLayout - gistSplit function result */
232 typedef struct SplitedPageLayout
233 {
234         gistxlogPage block;
235         IndexTupleData *list;
236         int                     lenlist;
237         IndexTuple      itup;                   /* union key for page */
238         Page            page;                   /* to operate */
239         Buffer          buffer;                 /* to write after all proceed */
240
241         struct SplitedPageLayout *next;
242 } SplitedPageLayout;
243
244 /*
245  * GISTInsertStack used for locking buffers and transfer arguments during
246  * insertion
247  */
248 typedef struct GISTInsertStack
249 {
250         /* current page */
251         BlockNumber blkno;
252         Buffer          buffer;
253         Page            page;
254
255         /*
256          * log sequence number from page->lsn to recognize page update and compare
257          * it with page's nsn to recognize page split
258          */
259         GistNSN         lsn;
260
261         /* offset of the downlink in the parent page, that points to this page */
262         OffsetNumber downlinkoffnum;
263
264         /* pointer to parent */
265         struct GISTInsertStack *parent;
266 } GISTInsertStack;
267
268 /* Working state and results for multi-column split logic in gistsplit.c */
269 typedef struct GistSplitVector
270 {
271         GIST_SPLITVEC splitVector;      /* passed to/from user PickSplit method */
272
273         Datum           spl_lattr[INDEX_MAX_KEYS];              /* Union of subkeys in
274                                                                                                  * splitVector.spl_left */
275         bool            spl_lisnull[INDEX_MAX_KEYS];
276
277         Datum           spl_rattr[INDEX_MAX_KEYS];              /* Union of subkeys in
278                                                                                                  * splitVector.spl_right */
279         bool            spl_risnull[INDEX_MAX_KEYS];
280
281         bool       *spl_dontcare;       /* flags tuples which could go to either side
282                                                                  * of the split for zero penalty */
283 } GistSplitVector;
284
285 typedef struct
286 {
287         Relation        r;
288         Size            freespace;              /* free space to be left */
289
290         GISTInsertStack *stack;
291 } GISTInsertState;
292
293 /* root page of a gist index */
294 #define GIST_ROOT_BLKNO                         0
295
296 /*
297  * Before PostgreSQL 9.1, we used to rely on so-called "invalid tuples" on
298  * inner pages to finish crash recovery of incomplete page splits. If a crash
299  * happened in the middle of a page split, so that the downlink pointers were
300  * not yet inserted, crash recovery inserted a special downlink pointer. The
301  * semantics of an invalid tuple was that it if you encounter one in a scan,
302  * it must always be followed, because we don't know if the tuples on the
303  * child page match or not.
304  *
305  * We no longer create such invalid tuples, we now mark the left-half of such
306  * an incomplete split with the F_FOLLOW_RIGHT flag instead, and finish the
307  * split properly the next time we need to insert on that page. To retain
308  * on-disk compatibility for the sake of pg_upgrade, we still store 0xffff as
309  * the offset number of all inner tuples. If we encounter any invalid tuples
310  * with 0xfffe during insertion, we throw an error, though scans still handle
311  * them. You should only encounter invalid tuples if you pg_upgrade a pre-9.1
312  * gist index which already has invalid tuples in it because of a crash. That
313  * should be rare, and you are recommended to REINDEX anyway if you have any
314  * invalid tuples in an index, so throwing an error is as far as we go with
315  * supporting that.
316  */
317 #define TUPLE_IS_VALID          0xffff
318 #define TUPLE_IS_INVALID        0xfffe
319
320 #define  GistTupleIsInvalid(itup)       ( ItemPointerGetOffsetNumber( &((itup)->t_tid) ) == TUPLE_IS_INVALID )
321 #define  GistTupleSetValid(itup)        ItemPointerSetOffsetNumber( &((itup)->t_tid), TUPLE_IS_VALID )
322
323
324
325
326 /*
327  * A buffer attached to an internal node, used when building an index in
328  * buffering mode.
329  */
330 typedef struct
331 {
332         BlockNumber nodeBlocknum;       /* index block # this buffer is for */
333         int32           blocksCount;    /* current # of blocks occupied by buffer */
334
335         BlockNumber pageBlocknum;       /* temporary file block # */
336         GISTNodeBufferPage *pageBuffer;         /* in-memory buffer page */
337
338         /* is this buffer queued for emptying? */
339         bool            queuedForEmptying;
340
341         /* is this a temporary copy, not in the hash table? */
342         bool            isTemp;
343
344         int                     level;                  /* 0 == leaf */
345 } GISTNodeBuffer;
346
347 /*
348  * Does specified level have buffers? (Beware of multiple evaluation of
349  * arguments.)
350  */
351 #define LEVEL_HAS_BUFFERS(nlevel, gfbb) \
352         ((nlevel) != 0 && (nlevel) % (gfbb)->levelStep == 0 && \
353          (nlevel) != (gfbb)->rootlevel)
354
355 /* Is specified buffer at least half-filled (should be queued for emptying)? */
356 #define BUFFER_HALF_FILLED(nodeBuffer, gfbb) \
357         ((nodeBuffer)->blocksCount > (gfbb)->pagesPerBuffer / 2)
358
359 /*
360  * Is specified buffer full? Our buffers can actually grow indefinitely,
361  * beyond the "maximum" size, so this just means whether the buffer has grown
362  * beyond the nominal maximum size.
363  */
364 #define BUFFER_OVERFLOWED(nodeBuffer, gfbb) \
365         ((nodeBuffer)->blocksCount > (gfbb)->pagesPerBuffer)
366
367 /*
368  * Data structure with general information about build buffers.
369  */
370 typedef struct GISTBuildBuffers
371 {
372         /* Persistent memory context for the buffers and metadata. */
373         MemoryContext context;
374
375         BufFile    *pfile;                      /* Temporary file to store buffers in */
376         long            nFileBlocks;    /* Current size of the temporary file */
377
378         /*
379          * resizable array of free blocks.
380          */
381         long       *freeBlocks;
382         int                     nFreeBlocks;    /* # of currently free blocks in the array */
383         int                     freeBlocksLen;  /* current allocated length of the array */
384
385         /* Hash for buffers by block number */
386         HTAB       *nodeBuffersTab;
387
388         /* List of buffers scheduled for emptying */
389         List       *bufferEmptyingQueue;
390
391         /*
392          * Parameters to the buffering build algorithm. levelStep determines which
393          * levels in the tree have buffers, and pagesPerBuffer determines how
394          * large each buffer is.
395          */
396         int                     levelStep;
397         int                     pagesPerBuffer;
398
399         /* Array of lists of buffers on each level, for final emptying */
400         List      **buffersOnLevels;
401         int                     buffersOnLevelsLen;
402
403         /*
404          * Dynamically-sized array of buffers that currently have their last page
405          * loaded in main memory.
406          */
407         GISTNodeBuffer **loadedBuffers;
408         int                     loadedBuffersCount;             /* # of entries in loadedBuffers */
409         int                     loadedBuffersLen;               /* allocated size of loadedBuffers */
410
411         /* Level of the current root node (= height of the index tree - 1) */
412         int                     rootlevel;
413 } GISTBuildBuffers;
414
415 /*
416  * Storage type for GiST's reloptions
417  */
418 typedef struct GiSTOptions
419 {
420         int32           vl_len_;                /* varlena header (do not touch directly!) */
421         int                     fillfactor;             /* page fill factor in percent (0..100) */
422         int                     bufferingModeOffset;    /* use buffering build? */
423 } GiSTOptions;
424
425 /* gist.c */
426 extern void gistbuildempty(Relation index);
427 extern bool gistinsert(Relation r, Datum *values, bool *isnull,
428                    ItemPointer ht_ctid, Relation heapRel,
429                    IndexUniqueCheck checkUnique,
430                    struct IndexInfo *indexInfo);
431 extern MemoryContext createTempGistContext(void);
432 extern GISTSTATE *initGISTstate(Relation index);
433 extern void freeGISTstate(GISTSTATE *giststate);
434 extern void gistdoinsert(Relation r,
435                          IndexTuple itup,
436                          Size freespace,
437                          GISTSTATE *GISTstate);
438
439 /* A List of these is returned from gistplacetopage() in *splitinfo */
440 typedef struct
441 {
442         Buffer          buf;                    /* the split page "half" */
443         IndexTuple      downlink;               /* downlink for this half. */
444 } GISTPageSplitInfo;
445
446 extern bool gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
447                                 Buffer buffer,
448                                 IndexTuple *itup, int ntup,
449                                 OffsetNumber oldoffnum, BlockNumber *newblkno,
450                                 Buffer leftchildbuf,
451                                 List **splitinfo,
452                                 bool markleftchild);
453
454 extern SplitedPageLayout *gistSplit(Relation r, Page page, IndexTuple *itup,
455                   int len, GISTSTATE *giststate);
456
457 /* gistxlog.c */
458 extern void gist_redo(XLogReaderState *record);
459 extern void gist_desc(StringInfo buf, XLogReaderState *record);
460 extern const char *gist_identify(uint8 info);
461 extern void gist_xlog_startup(void);
462 extern void gist_xlog_cleanup(void);
463 extern void gist_mask(char *pagedata, BlockNumber blkno);
464
465 extern XLogRecPtr gistXLogUpdate(Buffer buffer,
466                            OffsetNumber *todelete, int ntodelete,
467                            IndexTuple *itup, int ntup,
468                            Buffer leftchild);
469
470 extern XLogRecPtr gistXLogSplit(bool page_is_leaf,
471                           SplitedPageLayout *dist,
472                           BlockNumber origrlink, GistNSN oldnsn,
473                           Buffer leftchild, bool markfollowright);
474
475 /* gistget.c */
476 extern bool gistgettuple(IndexScanDesc scan, ScanDirection dir);
477 extern int64 gistgetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
478 extern bool gistcanreturn(Relation index, int attno);
479
480 /* gistvalidate.c */
481 extern bool gistvalidate(Oid opclassoid);
482
483 /* gistutil.c */
484
485 #define GiSTPageSize   \
486         ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GISTPageOpaqueData)) )
487
488 #define GIST_MIN_FILLFACTOR                     10
489 #define GIST_DEFAULT_FILLFACTOR         90
490
491 extern bytea *gistoptions(Datum reloptions, bool validate);
492 extern bool gistproperty(Oid index_oid, int attno,
493                          IndexAMProperty prop, const char *propname,
494                          bool *res, bool *isnull);
495 extern bool gistfitpage(IndexTuple *itvec, int len);
496 extern bool gistnospace(Page page, IndexTuple *itvec, int len, OffsetNumber todelete, Size freespace);
497 extern void gistcheckpage(Relation rel, Buffer buf);
498 extern Buffer gistNewBuffer(Relation r);
499 extern void gistfillbuffer(Page page, IndexTuple *itup, int len,
500                            OffsetNumber off);
501 extern IndexTuple *gistextractpage(Page page, int *len /* out */ );
502 extern IndexTuple *gistjoinvector(
503                            IndexTuple *itvec, int *len,
504                            IndexTuple *additvec, int addlen);
505 extern IndexTupleData *gistfillitupvec(IndexTuple *vec, int veclen, int *memlen);
506
507 extern IndexTuple gistunion(Relation r, IndexTuple *itvec,
508                   int len, GISTSTATE *giststate);
509 extern IndexTuple gistgetadjusted(Relation r,
510                                 IndexTuple oldtup,
511                                 IndexTuple addtup,
512                                 GISTSTATE *giststate);
513 extern IndexTuple gistFormTuple(GISTSTATE *giststate,
514                           Relation r, Datum *attdata, bool *isnull, bool isleaf);
515
516 extern OffsetNumber gistchoose(Relation r, Page p,
517                    IndexTuple it,
518                    GISTSTATE *giststate);
519
520 extern void GISTInitBuffer(Buffer b, uint32 f);
521 extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
522                            Datum k, Relation r, Page pg, OffsetNumber o,
523                            bool l, bool isNull);
524
525 extern float gistpenalty(GISTSTATE *giststate, int attno,
526                         GISTENTRY *key1, bool isNull1,
527                         GISTENTRY *key2, bool isNull2);
528 extern void gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len,
529                                    Datum *attr, bool *isnull);
530 extern bool gistKeyIsEQ(GISTSTATE *giststate, int attno, Datum a, Datum b);
531 extern void gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p,
532                                   OffsetNumber o, GISTENTRY *attdata, bool *isnull);
533 extern IndexTuple gistFetchTuple(GISTSTATE *giststate, Relation r,
534                            IndexTuple tuple);
535 extern void gistMakeUnionKey(GISTSTATE *giststate, int attno,
536                                  GISTENTRY *entry1, bool isnull1,
537                                  GISTENTRY *entry2, bool isnull2,
538                                  Datum *dst, bool *dstisnull);
539
540 extern XLogRecPtr gistGetFakeLSN(Relation rel);
541
542 /* gistvacuum.c */
543 extern IndexBulkDeleteResult *gistbulkdelete(IndexVacuumInfo *info,
544                            IndexBulkDeleteResult *stats,
545                            IndexBulkDeleteCallback callback,
546                            void *callback_state);
547 extern IndexBulkDeleteResult *gistvacuumcleanup(IndexVacuumInfo *info,
548                                   IndexBulkDeleteResult *stats);
549
550 /* gistsplit.c */
551 extern void gistSplitByKey(Relation r, Page page, IndexTuple *itup,
552                            int len, GISTSTATE *giststate,
553                            GistSplitVector *v,
554                            int attno);
555
556 /* gistbuild.c */
557 extern IndexBuildResult *gistbuild(Relation heap, Relation index,
558                   struct IndexInfo *indexInfo);
559 extern void gistValidateBufferingOption(char *value);
560
561 /* gistbuildbuffers.c */
562 extern GISTBuildBuffers *gistInitBuildBuffers(int pagesPerBuffer, int levelStep,
563                                          int maxLevel);
564 extern GISTNodeBuffer *gistGetNodeBuffer(GISTBuildBuffers *gfbb,
565                                   GISTSTATE *giststate,
566                                   BlockNumber blkno, int level);
567 extern void gistPushItupToNodeBuffer(GISTBuildBuffers *gfbb,
568                                                  GISTNodeBuffer *nodeBuffer, IndexTuple item);
569 extern bool gistPopItupFromNodeBuffer(GISTBuildBuffers *gfbb,
570                                                   GISTNodeBuffer *nodeBuffer, IndexTuple *item);
571 extern void gistFreeBuildBuffers(GISTBuildBuffers *gfbb);
572 extern void gistRelocateBuildBuffersOnSplit(GISTBuildBuffers *gfbb,
573                                                                 GISTSTATE *giststate, Relation r,
574                                                                 int level, Buffer buffer,
575                                                                 List *splitinfo);
576 extern void gistUnloadNodeBuffers(GISTBuildBuffers *gfbb);
577
578 #endif   /* GIST_PRIVATE_H */