PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/gin_private.h"
#include "access/ginxlog.h"
#include "access/xloginsert.h"
#include "miscadmin.h"
#include "storage/predicate.h"
#include "utils/injection_point.h"
#include "utils/memutils.h"
#include "utils/rel.h"
Go to the source code of this file.
Functions | |
static void | ginFindParents (GinBtree btree, GinBtreeStack *stack) |
static bool | ginPlaceToPage (GinBtree btree, GinBtreeStack *stack, void *insertdata, BlockNumber updateblkno, Buffer childbuf, GinStatsData *buildStats) |
static void | ginFinishSplit (GinBtree btree, GinBtreeStack *stack, bool freestack, GinStatsData *buildStats) |
static void | ginFinishOldSplit (GinBtree btree, GinBtreeStack *stack, GinStatsData *buildStats, int access) |
int | ginTraverseLock (Buffer buffer, bool searchMode) |
GinBtreeStack * | ginFindLeafPage (GinBtree btree, bool searchMode, bool rootConflictCheck) |
Buffer | ginStepRight (Buffer buffer, Relation index, int lockmode) |
void | freeGinBtreeStack (GinBtreeStack *stack) |
void | ginInsertValue (GinBtree btree, GinBtreeStack *stack, void *insertdata, GinStatsData *buildStats) |
void freeGinBtreeStack | ( | GinBtreeStack * | stack | ) |
Definition at line 198 of file ginbtree.c.
References GinBtreeStack::buffer, InvalidBuffer, GinBtreeStack::parent, pfree(), and ReleaseBuffer().
Referenced by entryLoadMoreItems(), ginEntryInsert(), ginFinishSplit(), ginInsertValue(), scanPostingTree(), and startScanEntry().
GinBtreeStack* ginFindLeafPage | ( | GinBtree | btree, |
bool | searchMode, | ||
bool | rootConflictCheck | ||
) |
Definition at line 83 of file ginbtree.c.
References Assert, GinBtreeStack::blkno, GinBtreeStack::buffer, BufferGetPage(), CheckForSerializableConflictIn(), GinBtreeData::findChildPage, GinBtreeData::fullScan, GIN_UNLOCK, ginFinishOldSplit(), GinPageGetOpaque, GinPageIsIncompleteSplit, GinPageIsLeaf, ginStepRight(), ginTraverseLock(), GinBtreeData::index, InvalidBlockNumber, InvalidOffsetNumber, GinBtreeData::isMoveRight, LockBuffer(), GinBtreeStack::off, palloc(), GinBtreeStack::parent, GinBtreeStack::predictNumber, ReadBuffer(), ReleaseAndReadBuffer(), and GinBtreeData::rootBlkno.
Referenced by entryLoadMoreItems(), ginEntryInsert(), ginInsertItemPointers(), ginScanBeginPostingTree(), and startScanEntry().
|
static |
Definition at line 218 of file ginbtree.c.
References Assert, GinBtreeStack::blkno, GinBtreeStack::buffer, BufferGetBlockNumber(), BufferGetPage(), elog, ERROR, GinBtreeData::findChildPtr, GinBtreeData::getLeftMostChild, GIN_EXCLUSIVE, GIN_UNLOCK, ginFinishOldSplit(), GinPageGetOpaque, GinPageIsIncompleteSplit, GinPageIsLeaf, ginStepRight(), GinBtreeData::index, InvalidBlockNumber, InvalidOffsetNumber, LockBuffer(), GinBtreeStack::off, palloc(), GinBtreeStack::parent, ReadBuffer(), ReleaseBuffer(), root, and GinBtreeData::rootBlkno.
Referenced by ginFinishSplit().
|
static |
Definition at line 779 of file ginbtree.c.
References GinBtreeStack::blkno, GinBtreeStack::buffer, BufferGetPage(), DEBUG1, elog, GIN_EXCLUSIVE, GIN_SHARE, GIN_UNLOCK, ginFinishSplit(), GinPageIsIncompleteSplit, GinBtreeData::index, INJECTION_POINT, LockBuffer(), and RelationGetRelationName.
Referenced by ginFindLeafPage(), ginFindParents(), ginFinishSplit(), and ginInsertValue().
|
static |
Definition at line 672 of file ginbtree.c.
References Assert, GinBtreeStack::blkno, GinBtreeStack::buffer, BufferGetBlockNumber(), BufferGetPage(), GinBtreeData::findChildPtr, freeGinBtreeStack(), GIN_EXCLUSIVE, GIN_UNLOCK, ginFindParents(), ginFinishOldSplit(), GinPageGetOpaque, GinPageIsIncompleteSplit, GinPageIsLeaf, GinPageRightMost, ginPlaceToPage(), ginStepRight(), GinBtreeData::index, INJECTION_POINT, InvalidOffsetNumber, LockBuffer(), GinBtreeStack::off, GinBtreeStack::parent, pfree(), GinBtreeData::prepareDownlink, and ReleaseBuffer().
Referenced by ginFinishOldSplit(), and ginInsertValue().
void ginInsertValue | ( | GinBtree | btree, |
GinBtreeStack * | stack, | ||
void * | insertdata, | ||
GinStatsData * | buildStats | ||
) |
Definition at line 816 of file ginbtree.c.
References GinBtreeStack::buffer, BufferGetPage(), freeGinBtreeStack(), GIN_EXCLUSIVE, GIN_UNLOCK, ginFinishOldSplit(), ginFinishSplit(), GinPageIsIncompleteSplit, ginPlaceToPage(), InvalidBlockNumber, InvalidBuffer, and LockBuffer().
Referenced by ginEntryInsert(), and ginInsertItemPointers().
|
static |
Definition at line 337 of file ginbtree.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, GinBtreeData::beginPlaceToPage, BlockIdSet(), GinBtreeStack::buffer, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), CurrentMemoryContext, data, elog, END_CRIT_SECTION, ERROR, GinBtreeData::execPlaceToPage, GinBtreeData::fillRoot, ginxlogInsert::flags, GIN_COMPRESSED, GIN_INCOMPLETE_SPLIT, GIN_INSERT_ISDATA, GIN_INSERT_ISLEAF, GIN_LEAF, GIN_SPLIT_ROOT, GinInitPage(), GinNewBuffer(), GinPageGetOpaque, GinPageIsData, GinPageIsLeaf, GPTP_INSERT, GPTP_NO_WORK, GPTP_SPLIT, GinBtreeData::index, InvalidBlockNumber, InvalidBuffer, GinBtreeData::isBuild, GinBtreeData::isData, MarkBufferDirty(), MemoryContextDelete(), MemoryContextSwitchTo(), GinStatsData::nDataPages, GinStatsData::nEntryPages, PageGetTempPage(), PageSetLSN(), GinBtreeStack::parent, PredicateLockPageSplit(), RelationData::rd_locator, REGBUF_FORCE_IMAGE, REGBUF_STANDARD, RelationNeedsWAL, START_CRIT_SECTION, UnlockReleaseBuffer(), XLOG_GIN_INSERT, XLOG_GIN_SPLIT, XLogBeginInsert(), XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by ginFinishSplit(), and ginInsertValue().
Definition at line 177 of file ginbtree.c.
References BufferGetPage(), elog, ERROR, GinPageGetOpaque, GinPageIsData, GinPageIsLeaf, LockBuffer(), ReadBuffer(), and UnlockReleaseBuffer().
Referenced by entryLoadMoreItems(), ginFindLeafPage(), ginFindParents(), ginFinishSplit(), moveRightIfItNeeded(), and scanPostingTree().
Definition at line 39 of file ginbtree.c.
References BufferGetPage(), GIN_EXCLUSIVE, GIN_SHARE, GIN_UNLOCK, GinPageIsLeaf, and LockBuffer().
Referenced by ginFindLeafPage().