PostgreSQL Source Code  git master
ginblock.h File Reference
#include "access/transam.h"
#include "storage/block.h"
#include "storage/bufpage.h"
#include "storage/itemptr.h"
#include "storage/off.h"
Include dependency graph for ginblock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GinPageOpaqueData
 
struct  GinMetaPageData
 
struct  PostingItem
 
struct  GinPostingList
 

Macros

#define GIN_DATA   (1 << 0)
 
#define GIN_LEAF   (1 << 1)
 
#define GIN_DELETED   (1 << 2)
 
#define GIN_META   (1 << 3)
 
#define GIN_LIST   (1 << 4)
 
#define GIN_LIST_FULLROW   (1 << 5) /* makes sense only on GIN_LIST page */
 
#define GIN_INCOMPLETE_SPLIT
 
#define GIN_COMPRESSED   (1 << 7)
 
#define GIN_METAPAGE_BLKNO   (0)
 
#define GIN_ROOT_BLKNO   (1)
 
#define GIN_CURRENT_VERSION   2
 
#define GinPageGetMeta(p)    ((GinMetaPageData *) PageGetContents(p))
 
#define GinPageGetOpaque(page)   ( (GinPageOpaque) PageGetSpecialPointer(page) )
 
#define GinPageIsLeaf(page)   ( (GinPageGetOpaque(page)->flags & GIN_LEAF) != 0 )
 
#define GinPageSetLeaf(page)   ( GinPageGetOpaque(page)->flags |= GIN_LEAF )
 
#define GinPageSetNonLeaf(page)   ( GinPageGetOpaque(page)->flags &= ~GIN_LEAF )
 
#define GinPageIsData(page)   ( (GinPageGetOpaque(page)->flags & GIN_DATA) != 0 )
 
#define GinPageSetData(page)   ( GinPageGetOpaque(page)->flags |= GIN_DATA )
 
#define GinPageIsList(page)   ( (GinPageGetOpaque(page)->flags & GIN_LIST) != 0 )
 
#define GinPageSetList(page)   ( GinPageGetOpaque(page)->flags |= GIN_LIST )
 
#define GinPageHasFullRow(page)   ( (GinPageGetOpaque(page)->flags & GIN_LIST_FULLROW) != 0 )
 
#define GinPageSetFullRow(page)   ( GinPageGetOpaque(page)->flags |= GIN_LIST_FULLROW )
 
#define GinPageIsCompressed(page)   ( (GinPageGetOpaque(page)->flags & GIN_COMPRESSED) != 0 )
 
#define GinPageSetCompressed(page)   ( GinPageGetOpaque(page)->flags |= GIN_COMPRESSED )
 
#define GinPageIsDeleted(page)   ( (GinPageGetOpaque(page)->flags & GIN_DELETED) != 0 )
 
#define GinPageSetDeleted(page)   ( GinPageGetOpaque(page)->flags |= GIN_DELETED)
 
#define GinPageSetNonDeleted(page)   ( GinPageGetOpaque(page)->flags &= ~GIN_DELETED)
 
#define GinPageIsIncompleteSplit(page)   ( (GinPageGetOpaque(page)->flags & GIN_INCOMPLETE_SPLIT) != 0 )
 
#define GinPageRightMost(page)   ( GinPageGetOpaque(page)->rightlink == InvalidBlockNumber)
 
#define GinPageGetDeleteXid(page)   ( ((PageHeader) (page))->pd_prune_xid )
 
#define GinPageSetDeleteXid(page, xid)   ( ((PageHeader) (page))->pd_prune_xid = xid)
 
#define GinItemPointerGetBlockNumber(pointer)    (ItemPointerGetBlockNumberNoCheck(pointer))
 
#define GinItemPointerGetOffsetNumber(pointer)    (ItemPointerGetOffsetNumberNoCheck(pointer))
 
#define GinItemPointerSetBlockNumber(pointer, blkno)    (ItemPointerSetBlockNumber((pointer), (blkno)))
 
#define GinItemPointerSetOffsetNumber(pointer, offnum)    (ItemPointerSetOffsetNumber((pointer), (offnum)))
 
#define ItemPointerSetMin(p)    ItemPointerSet((p), (BlockNumber)0, (OffsetNumber)0)
 
#define ItemPointerIsMin(p)
 
#define ItemPointerSetMax(p)    ItemPointerSet((p), InvalidBlockNumber, (OffsetNumber)0xffff)
 
#define ItemPointerSetLossyPage(p, b)    ItemPointerSet((p), (b), (OffsetNumber)0xffff)
 
#define ItemPointerIsLossyPage(p)
 
#define PostingItemGetBlockNumber(pointer)    BlockIdGetBlockNumber(&(pointer)->child_blkno)
 
#define PostingItemSetBlockNumber(pointer, blockNumber)    BlockIdSet(&((pointer)->child_blkno), (blockNumber))
 
#define GIN_CAT_NORM_KEY   0 /* normal, non-null key value */
 
#define GIN_CAT_NULL_KEY   1 /* null key value */
 
#define GIN_CAT_EMPTY_ITEM   2 /* placeholder for zero-key item */
 
#define GIN_CAT_NULL_ITEM   3 /* placeholder for null item */
 
#define GIN_CAT_EMPTY_QUERY   (-1) /* placeholder for full-scan query */
 
#define GinCategoryOffset(itup, ginstate)
 
#define GinGetNullCategory(itup, ginstate)    (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))))
 
#define GinSetNullCategory(itup, ginstate, c)    (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))) = (c))
 
#define GinGetNPosting(itup)   GinItemPointerGetOffsetNumber(&(itup)->t_tid)
 
#define GinSetNPosting(itup, n)   ItemPointerSetOffsetNumber(&(itup)->t_tid,n)
 
#define GIN_TREE_POSTING   ((OffsetNumber)0xffff)
 
#define GinIsPostingTree(itup)   (GinGetNPosting(itup) == GIN_TREE_POSTING)
 
#define GinSetPostingTree(itup, blkno)   ( GinSetNPosting((itup),GIN_TREE_POSTING), ItemPointerSetBlockNumber(&(itup)->t_tid, blkno) )
 
#define GinGetPostingTree(itup)   GinItemPointerGetBlockNumber(&(itup)->t_tid)
 
#define GIN_ITUP_COMPRESSED   (1U << 31)
 
#define GinGetPostingOffset(itup)   (GinItemPointerGetBlockNumber(&(itup)->t_tid) & (~GIN_ITUP_COMPRESSED))
 
#define GinSetPostingOffset(itup, n)   ItemPointerSetBlockNumber(&(itup)->t_tid,(n)|GIN_ITUP_COMPRESSED)
 
#define GinGetPosting(itup)   ((Pointer) ((char*)(itup) + GinGetPostingOffset(itup)))
 
#define GinItupIsCompressed(itup)   ((GinItemPointerGetBlockNumber(&(itup)->t_tid) & GIN_ITUP_COMPRESSED) != 0)
 
#define GinMaxItemSize
 
#define GinGetDownlink(itup)   GinItemPointerGetBlockNumber(&(itup)->t_tid)
 
#define GinSetDownlink(itup, blkno)   ItemPointerSet(&(itup)->t_tid, blkno, InvalidOffsetNumber)
 
#define GinDataLeafPageGetPostingList(page)    (GinPostingList *) ((PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData))))
 
#define GinDataLeafPageGetPostingListSize(page)    (((PageHeader) page)->pd_lower - MAXALIGN(SizeOfPageHeaderData) - MAXALIGN(sizeof(ItemPointerData)))
 
#define GinDataLeafPageIsEmpty(page)    (GinPageIsCompressed(page) ? (GinDataLeafPageGetPostingListSize(page) == 0) : (GinPageGetOpaque(page)->maxoff < FirstOffsetNumber))
 
#define GinDataLeafPageGetFreeSpace(page)   PageGetExactFreeSpace(page)
 
#define GinDataPageGetRightBound(page)   ((ItemPointer) PageGetContents(page))
 
#define GinDataPageGetData(page)    (PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData)))
 
#define GinDataPageGetPostingItem(page, i)    ((PostingItem *) (GinDataPageGetData(page) + ((i)-1) * sizeof(PostingItem)))
 
#define GinDataPageSetDataSize(page, size)
 
#define GinNonLeafDataPageGetFreeSpace(page)
 
#define GinDataPageMaxDataSize
 
#define GinListPageSize    ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GinPageOpaqueData)) )
 
#define SizeOfGinPostingList(plist)   (offsetof(GinPostingList, bytes) + SHORTALIGN((plist)->nbytes) )
 
#define GinNextPostingListSegment(cur)   ((GinPostingList *) (((char *) (cur)) + SizeOfGinPostingList((cur))))
 

Typedefs

typedef struct GinPageOpaqueData GinPageOpaqueData
 
typedef GinPageOpaqueDataGinPageOpaque
 
typedef struct GinMetaPageData GinMetaPageData
 
typedef signed char GinNullCategory
 

Functions

bool GinPageIsRecyclable (Page page)
 

Macro Definition Documentation

◆ GIN_CAT_EMPTY_ITEM

#define GIN_CAT_EMPTY_ITEM   2 /* placeholder for zero-key item */

Definition at line 210 of file ginblock.h.

◆ GIN_CAT_EMPTY_QUERY

#define GIN_CAT_EMPTY_QUERY   (-1) /* placeholder for full-scan query */

Definition at line 212 of file ginblock.h.

◆ GIN_CAT_NORM_KEY

#define GIN_CAT_NORM_KEY   0 /* normal, non-null key value */

Definition at line 208 of file ginblock.h.

◆ GIN_CAT_NULL_ITEM

#define GIN_CAT_NULL_ITEM   3 /* placeholder for null item */

Definition at line 211 of file ginblock.h.

◆ GIN_CAT_NULL_KEY

#define GIN_CAT_NULL_KEY   1 /* null key value */

Definition at line 209 of file ginblock.h.

◆ GIN_COMPRESSED

#define GIN_COMPRESSED   (1 << 7)

Definition at line 48 of file ginblock.h.

◆ GIN_CURRENT_VERSION

#define GIN_CURRENT_VERSION   2

Definition at line 102 of file ginblock.h.

◆ GIN_DATA

#define GIN_DATA   (1 << 0)

Definition at line 41 of file ginblock.h.

◆ GIN_DELETED

#define GIN_DELETED   (1 << 2)

Definition at line 43 of file ginblock.h.

◆ GIN_INCOMPLETE_SPLIT

#define GIN_INCOMPLETE_SPLIT
Value:
(1 << 6) /* page was split, but parent not
* updated */

Definition at line 47 of file ginblock.h.

◆ GIN_ITUP_COMPRESSED

#define GIN_ITUP_COMPRESSED   (1U << 31)

Definition at line 235 of file ginblock.h.

◆ GIN_LEAF

#define GIN_LEAF   (1 << 1)

Definition at line 42 of file ginblock.h.

◆ GIN_LIST

#define GIN_LIST   (1 << 4)

Definition at line 45 of file ginblock.h.

◆ GIN_LIST_FULLROW

#define GIN_LIST_FULLROW   (1 << 5) /* makes sense only on GIN_LIST page */

Definition at line 46 of file ginblock.h.

◆ GIN_META

#define GIN_META   (1 << 3)

Definition at line 44 of file ginblock.h.

◆ GIN_METAPAGE_BLKNO

#define GIN_METAPAGE_BLKNO   (0)

Definition at line 51 of file ginblock.h.

◆ GIN_ROOT_BLKNO

#define GIN_ROOT_BLKNO   (1)

Definition at line 52 of file ginblock.h.

◆ GIN_TREE_POSTING

#define GIN_TREE_POSTING   ((OffsetNumber)0xffff)

Definition at line 230 of file ginblock.h.

◆ GinCategoryOffset

#define GinCategoryOffset (   itup,
  ginstate 
)
Value:
(IndexInfoFindDataOffset((itup)->t_info) + \
((ginstate)->oneCol ? 0 : sizeof(int16)))
signed short int16
Definition: c.h:496
static Size IndexInfoFindDataOffset(unsigned short t_info)
Definition: itup.h:98

Definition at line 217 of file ginblock.h.

◆ GinDataLeafPageGetFreeSpace

#define GinDataLeafPageGetFreeSpace (   page)    PageGetExactFreeSpace(page)

Definition at line 286 of file ginblock.h.

◆ GinDataLeafPageGetPostingList

#define GinDataLeafPageGetPostingList (   page)     (GinPostingList *) ((PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData))))

Definition at line 278 of file ginblock.h.

◆ GinDataLeafPageGetPostingListSize

#define GinDataLeafPageGetPostingListSize (   page)     (((PageHeader) page)->pd_lower - MAXALIGN(SizeOfPageHeaderData) - MAXALIGN(sizeof(ItemPointerData)))

Definition at line 280 of file ginblock.h.

◆ GinDataLeafPageIsEmpty

#define GinDataLeafPageIsEmpty (   page)     (GinPageIsCompressed(page) ? (GinDataLeafPageGetPostingListSize(page) == 0) : (GinPageGetOpaque(page)->maxoff < FirstOffsetNumber))

Definition at line 283 of file ginblock.h.

◆ GinDataPageGetData

#define GinDataPageGetData (   page)     (PageGetContents(page) + MAXALIGN(sizeof(ItemPointerData)))

Definition at line 295 of file ginblock.h.

◆ GinDataPageGetPostingItem

#define GinDataPageGetPostingItem (   page,
  i 
)     ((PostingItem *) (GinDataPageGetData(page) + ((i)-1) * sizeof(PostingItem)))

Definition at line 298 of file ginblock.h.

◆ GinDataPageGetRightBound

#define GinDataPageGetRightBound (   page)    ((ItemPointer) PageGetContents(page))

Definition at line 288 of file ginblock.h.

◆ GinDataPageMaxDataSize

#define GinDataPageMaxDataSize
Value:
#define SizeOfPageHeaderData
Definition: bufpage.h:216
#define MAXALIGN(LEN)
Definition: c.h:814

Definition at line 319 of file ginblock.h.

◆ GinDataPageSetDataSize

#define GinDataPageSetDataSize (   page,
  size 
)
Value:
{ \
((PageHeader) page)->pd_lower = (size) + MAXALIGN(SizeOfPageHeaderData) + MAXALIGN(sizeof(ItemPointerData)); \
}
PageHeaderData * PageHeader
Definition: bufpage.h:173
#define GinDataPageMaxDataSize
Definition: ginblock.h:319
static pg_noinline void Size size
Definition: slab.c:607

Definition at line 309 of file ginblock.h.

◆ GinGetDownlink

#define GinGetDownlink (   itup)    GinItemPointerGetBlockNumber(&(itup)->t_tid)

Definition at line 257 of file ginblock.h.

◆ GinGetNPosting

#define GinGetNPosting (   itup)    GinItemPointerGetOffsetNumber(&(itup)->t_tid)

Definition at line 228 of file ginblock.h.

◆ GinGetNullCategory

#define GinGetNullCategory (   itup,
  ginstate 
)     (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))))

Definition at line 220 of file ginblock.h.

◆ GinGetPosting

#define GinGetPosting (   itup)    ((Pointer) ((char*)(itup) + GinGetPostingOffset(itup)))

Definition at line 238 of file ginblock.h.

◆ GinGetPostingOffset

#define GinGetPostingOffset (   itup)    (GinItemPointerGetBlockNumber(&(itup)->t_tid) & (~GIN_ITUP_COMPRESSED))

Definition at line 236 of file ginblock.h.

◆ GinGetPostingTree

#define GinGetPostingTree (   itup)    GinItemPointerGetBlockNumber(&(itup)->t_tid)

Definition at line 233 of file ginblock.h.

◆ GinIsPostingTree

#define GinIsPostingTree (   itup)    (GinGetNPosting(itup) == GIN_TREE_POSTING)

Definition at line 231 of file ginblock.h.

◆ GinItemPointerGetBlockNumber

#define GinItemPointerGetBlockNumber (   pointer)     (ItemPointerGetBlockNumberNoCheck(pointer))

Definition at line 143 of file ginblock.h.

◆ GinItemPointerGetOffsetNumber

#define GinItemPointerGetOffsetNumber (   pointer)     (ItemPointerGetOffsetNumberNoCheck(pointer))

Definition at line 146 of file ginblock.h.

◆ GinItemPointerSetBlockNumber

#define GinItemPointerSetBlockNumber (   pointer,
  blkno 
)     (ItemPointerSetBlockNumber((pointer), (blkno)))

Definition at line 149 of file ginblock.h.

◆ GinItemPointerSetOffsetNumber

#define GinItemPointerSetOffsetNumber (   pointer,
  offnum 
)     (ItemPointerSetOffsetNumber((pointer), (offnum)))

Definition at line 152 of file ginblock.h.

◆ GinItupIsCompressed

#define GinItupIsCompressed (   itup)    ((GinItemPointerGetBlockNumber(&(itup)->t_tid) & GIN_ITUP_COMPRESSED) != 0)

Definition at line 239 of file ginblock.h.

◆ GinListPageSize

#define GinListPageSize    ( BLCKSZ - SizeOfPageHeaderData - MAXALIGN(sizeof(GinPageOpaqueData)) )

Definition at line 327 of file ginblock.h.

◆ GinMaxItemSize

#define GinMaxItemSize
Value:
MAXALIGN_DOWN(((BLCKSZ - \
MAXALIGN(sizeof(GinPageOpaqueData))) / 3)))
#define MAXALIGN_DOWN(LEN)
Definition: c.h:826
#define Min(x, y)
Definition: c.h:1007
#define INDEX_SIZE_MASK
Definition: itup.h:65

Definition at line 248 of file ginblock.h.

◆ GinNextPostingListSegment

#define GinNextPostingListSegment (   cur)    ((GinPostingList *) (((char *) (cur)) + SizeOfGinPostingList((cur))))

Definition at line 343 of file ginblock.h.

◆ GinNonLeafDataPageGetFreeSpace

#define GinNonLeafDataPageGetFreeSpace (   page)
Value:
GinPageGetOpaque(page)->maxoff * sizeof(PostingItem))

Definition at line 315 of file ginblock.h.

◆ GinPageGetDeleteXid

#define GinPageGetDeleteXid (   page)    ( ((PageHeader) (page))->pd_prune_xid )

Definition at line 135 of file ginblock.h.

◆ GinPageGetMeta

#define GinPageGetMeta (   p)     ((GinMetaPageData *) PageGetContents(p))

Definition at line 104 of file ginblock.h.

◆ GinPageGetOpaque

#define GinPageGetOpaque (   page)    ( (GinPageOpaque) PageGetSpecialPointer(page) )

Definition at line 110 of file ginblock.h.

◆ GinPageHasFullRow

#define GinPageHasFullRow (   page)    ( (GinPageGetOpaque(page)->flags & GIN_LIST_FULLROW) != 0 )

Definition at line 119 of file ginblock.h.

◆ GinPageIsCompressed

#define GinPageIsCompressed (   page)    ( (GinPageGetOpaque(page)->flags & GIN_COMPRESSED) != 0 )

Definition at line 121 of file ginblock.h.

◆ GinPageIsData

#define GinPageIsData (   page)    ( (GinPageGetOpaque(page)->flags & GIN_DATA) != 0 )

Definition at line 115 of file ginblock.h.

◆ GinPageIsDeleted

#define GinPageIsDeleted (   page)    ( (GinPageGetOpaque(page)->flags & GIN_DELETED) != 0 )

Definition at line 124 of file ginblock.h.

◆ GinPageIsIncompleteSplit

#define GinPageIsIncompleteSplit (   page)    ( (GinPageGetOpaque(page)->flags & GIN_INCOMPLETE_SPLIT) != 0 )

Definition at line 127 of file ginblock.h.

◆ GinPageIsLeaf

#define GinPageIsLeaf (   page)    ( (GinPageGetOpaque(page)->flags & GIN_LEAF) != 0 )

Definition at line 112 of file ginblock.h.

◆ GinPageIsList

#define GinPageIsList (   page)    ( (GinPageGetOpaque(page)->flags & GIN_LIST) != 0 )

Definition at line 117 of file ginblock.h.

◆ GinPageRightMost

#define GinPageRightMost (   page)    ( GinPageGetOpaque(page)->rightlink == InvalidBlockNumber)

Definition at line 129 of file ginblock.h.

◆ GinPageSetCompressed

#define GinPageSetCompressed (   page)    ( GinPageGetOpaque(page)->flags |= GIN_COMPRESSED )

Definition at line 122 of file ginblock.h.

◆ GinPageSetData

#define GinPageSetData (   page)    ( GinPageGetOpaque(page)->flags |= GIN_DATA )

Definition at line 116 of file ginblock.h.

◆ GinPageSetDeleted

#define GinPageSetDeleted (   page)    ( GinPageGetOpaque(page)->flags |= GIN_DELETED)

Definition at line 125 of file ginblock.h.

◆ GinPageSetDeleteXid

#define GinPageSetDeleteXid (   page,
  xid 
)    ( ((PageHeader) (page))->pd_prune_xid = xid)

Definition at line 136 of file ginblock.h.

◆ GinPageSetFullRow

#define GinPageSetFullRow (   page)    ( GinPageGetOpaque(page)->flags |= GIN_LIST_FULLROW )

Definition at line 120 of file ginblock.h.

◆ GinPageSetLeaf

#define GinPageSetLeaf (   page)    ( GinPageGetOpaque(page)->flags |= GIN_LEAF )

Definition at line 113 of file ginblock.h.

◆ GinPageSetList

#define GinPageSetList (   page)    ( GinPageGetOpaque(page)->flags |= GIN_LIST )

Definition at line 118 of file ginblock.h.

◆ GinPageSetNonDeleted

#define GinPageSetNonDeleted (   page)    ( GinPageGetOpaque(page)->flags &= ~GIN_DELETED)

Definition at line 126 of file ginblock.h.

◆ GinPageSetNonLeaf

#define GinPageSetNonLeaf (   page)    ( GinPageGetOpaque(page)->flags &= ~GIN_LEAF )

Definition at line 114 of file ginblock.h.

◆ GinSetDownlink

#define GinSetDownlink (   itup,
  blkno 
)    ItemPointerSet(&(itup)->t_tid, blkno, InvalidOffsetNumber)

Definition at line 258 of file ginblock.h.

◆ GinSetNPosting

#define GinSetNPosting (   itup,
 
)    ItemPointerSetOffsetNumber(&(itup)->t_tid,n)

Definition at line 229 of file ginblock.h.

◆ GinSetNullCategory

#define GinSetNullCategory (   itup,
  ginstate,
  c 
)     (*((GinNullCategory *) ((char*)(itup) + GinCategoryOffset(itup,ginstate))) = (c))

Definition at line 222 of file ginblock.h.

◆ GinSetPostingOffset

#define GinSetPostingOffset (   itup,
 
)    ItemPointerSetBlockNumber(&(itup)->t_tid,(n)|GIN_ITUP_COMPRESSED)

Definition at line 237 of file ginblock.h.

◆ GinSetPostingTree

#define GinSetPostingTree (   itup,
  blkno 
)    ( GinSetNPosting((itup),GIN_TREE_POSTING), ItemPointerSetBlockNumber(&(itup)->t_tid, blkno) )

Definition at line 232 of file ginblock.h.

◆ ItemPointerIsLossyPage

#define ItemPointerIsLossyPage (   p)
Value:
#define InvalidBlockNumber
Definition: block.h:33
#define GinItemPointerGetOffsetNumber(pointer)
Definition: ginblock.h:146
#define GinItemPointerGetBlockNumber(pointer)
Definition: ginblock.h:143
uint16 OffsetNumber
Definition: off.h:24

Definition at line 175 of file ginblock.h.

◆ ItemPointerIsMin

#define ItemPointerIsMin (   p)
Value:

Definition at line 168 of file ginblock.h.

◆ ItemPointerSetLossyPage

#define ItemPointerSetLossyPage (   p,
  b 
)     ItemPointerSet((p), (b), (OffsetNumber)0xffff)

Definition at line 173 of file ginblock.h.

◆ ItemPointerSetMax

#define ItemPointerSetMax (   p)     ItemPointerSet((p), InvalidBlockNumber, (OffsetNumber)0xffff)

Definition at line 171 of file ginblock.h.

◆ ItemPointerSetMin

#define ItemPointerSetMin (   p)     ItemPointerSet((p), (BlockNumber)0, (OffsetNumber)0)

Definition at line 166 of file ginblock.h.

◆ PostingItemGetBlockNumber

#define PostingItemGetBlockNumber (   pointer)     BlockIdGetBlockNumber(&(pointer)->child_blkno)

Definition at line 189 of file ginblock.h.

◆ PostingItemSetBlockNumber

#define PostingItemSetBlockNumber (   pointer,
  blockNumber 
)     BlockIdSet(&((pointer)->child_blkno), (blockNumber))

Definition at line 192 of file ginblock.h.

◆ SizeOfGinPostingList

#define SizeOfGinPostingList (   plist)    (offsetof(GinPostingList, bytes) + SHORTALIGN((plist)->nbytes) )

Definition at line 342 of file ginblock.h.

Typedef Documentation

◆ GinMetaPageData

◆ GinNullCategory

typedef signed char GinNullCategory

Definition at line 206 of file ginblock.h.

◆ GinPageOpaque

Definition at line 39 of file ginblock.h.

◆ GinPageOpaqueData

Function Documentation

◆ GinPageIsRecyclable()

bool GinPageIsRecyclable ( Page  page)

Definition at line 802 of file ginvacuum.c.

803 {
804  TransactionId delete_xid;
805 
806  if (PageIsNew(page))
807  return true;
808 
809  if (!GinPageIsDeleted(page))
810  return false;
811 
812  delete_xid = GinPageGetDeleteXid(page);
813 
814  if (!TransactionIdIsValid(delete_xid))
815  return true;
816 
817  /*
818  * If no backend still could view delete_xid as in running, all scans
819  * concurrent with ginDeletePage() must have finished.
820  */
821  return GlobalVisCheckRemovableXid(NULL, delete_xid);
822 }
static bool PageIsNew(Page page)
Definition: bufpage.h:233
uint32 TransactionId
Definition: c.h:655
#define GinPageGetDeleteXid(page)
Definition: ginblock.h:135
#define GinPageIsDeleted(page)
Definition: ginblock.h:124
bool GlobalVisCheckRemovableXid(Relation rel, TransactionId xid)
Definition: procarray.c:4304
#define TransactionIdIsValid(xid)
Definition: transam.h:41

References GinPageGetDeleteXid, GinPageIsDeleted, GlobalVisCheckRemovableXid(), PageIsNew(), and TransactionIdIsValid.

Referenced by GinNewBuffer(), and ginvacuumcleanup().