48 if (searchMode ==
false)
84 bool rootConflictCheck)
94 if (rootConflictCheck)
130 stack->
blkno = rightlink;
150 stack->
blkno = child;
159 stack->
blkno = child;
192 elog(
ERROR,
"right sibling of GIN page is of different type");
247 buffer =
root->buffer;
284 if (buffer !=
root->buffer)
316 blkno = leftmostBlkno;
345 Page childpage = NULL;
346 Page newlpage = NULL,
348 void *ptp_workspace = NULL;
359 "ginPlaceToPage temporary context",
385 insertdata, updateblkno,
387 &newlpage, &newrpage);
407 insertdata, updateblkno, ptp_workspace);
424 xlrec.
flags = xlflags;
462 Page newrootpg = NULL;
480 data.flags = xlflags;
489 if (stack->
parent == NULL)
540 data.rrlink = savedRightLink;
572 if (stack->
parent == NULL)
576 memcpy(page, newrootpg, BLCKSZ);
583 memcpy(page, newlpage, BLCKSZ);
606 if (stack->
parent == NULL)
626 if (stack->
parent == NULL)
638 if (stack->
parent == NULL)
646 result = (stack->
parent == NULL);
650 elog(
ERROR,
"invalid return code from GIN beginPlaceToPage method: %d", rc);
686 #ifdef USE_INJECTION_POINTS
737 insertdata, updateblkno,
738 stack->
buffer, buildStats);
747 if (!first || freestack)
782 elog(
DEBUG1,
"finishing incomplete split of block %u in gin index \"%s\"",
#define InvalidBlockNumber
static void BlockIdSet(BlockIdData *blockId, BlockNumber blockNumber)
BlockNumber BufferGetBlockNumber(Buffer buffer)
Buffer ReleaseAndReadBuffer(Buffer buffer, Relation relation, BlockNumber blockNum)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void MarkBufferDirty(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
static Page BufferGetPage(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
Page PageGetTempPage(Page page)
static void PageSetLSN(Page page, XLogRecPtr lsn)
#define Assert(condition)
#define GinPageGetOpaque(page)
#define GinPageIsData(page)
#define GinPageRightMost(page)
#define GIN_INCOMPLETE_SPLIT
#define GinPageIsLeaf(page)
#define GinPageIsIncompleteSplit(page)
int ginTraverseLock(Buffer buffer, bool searchMode)
void freeGinBtreeStack(GinBtreeStack *stack)
void ginInsertValue(GinBtree btree, GinBtreeStack *stack, void *insertdata, GinStatsData *buildStats)
static bool ginPlaceToPage(GinBtree btree, GinBtreeStack *stack, void *insertdata, BlockNumber updateblkno, Buffer childbuf, GinStatsData *buildStats)
static void ginFindParents(GinBtree btree, GinBtreeStack *stack)
static void ginFinishSplit(GinBtree btree, GinBtreeStack *stack, bool freestack, GinStatsData *buildStats)
static void ginFinishOldSplit(GinBtree btree, GinBtreeStack *stack, GinStatsData *buildStats, int access)
Buffer ginStepRight(Buffer buffer, Relation index, int lockmode)
GinBtreeStack * ginFindLeafPage(GinBtree btree, bool searchMode, bool rootConflictCheck)
void GinInitPage(Page page, uint32 f, Size pageSize)
Buffer GinNewBuffer(Relation index)
#define GIN_INSERT_ISDATA
#define GIN_INSERT_ISLEAF
#define INJECTION_POINT(name)
void pfree(void *pointer)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define InvalidOffsetNumber
void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno)
void CheckForSerializableConflictIn(Relation relation, ItemPointer tid, BlockNumber blkno)
MemoryContextSwitchTo(old_ctx)
#define RelationGetRelationName(relation)
#define RelationNeedsWAL(relation)
BlockNumber(* findChildPage)(GinBtree, GinBtreeStack *)
void(* execPlaceToPage)(GinBtree, Buffer, GinBtreeStack *, void *, BlockNumber, void *)
BlockNumber(* getLeftMostChild)(GinBtree, Page)
bool(* isMoveRight)(GinBtree, Page)
GinPlaceToPageRC(* beginPlaceToPage)(GinBtree, Buffer, GinBtreeStack *, void *, BlockNumber, void **, Page *, Page *)
void *(* prepareDownlink)(GinBtree, Buffer)
OffsetNumber(* findChildPtr)(GinBtree, Page, BlockNumber, OffsetNumber)
void(* fillRoot)(GinBtree, Page, BlockNumber, Page, BlockNumber, Page)
struct GinBtreeStack * parent
RelFileLocator rd_locator
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterData(const char *data, uint32 len)
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
void XLogBeginInsert(void)
#define REGBUF_FORCE_IMAGE