53 memcpy(page, buildstate->
data.
data, BLCKSZ);
65 buildstate->
count = 0;
73 bool *isnull,
bool tupleIsAlive,
void *
state)
101 elog(
ERROR,
"could not add new bloom tuple to empty page");
126 elog(
ERROR,
"index \"%s\" already contains data",
133 memset(&buildstate, 0,
sizeof(buildstate));
136 "Bloom build temporary context",
146 if (buildstate.
count > 0)
192 "Bloom insert temporary context",
257 nStart = metaData->
nStart;
260 if (nStart < metaData->nEnd &&
277 if (nStart >= metaData->
nEnd)
294 metaData->
nStart = nStart;
321 elog(
ERROR,
"could not add new bloom tuple to empty page");
static void initCachedPage(BloomBuildState *buildstate)
void blbuildempty(Relation index)
IndexBuildResult * blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
static void flushCachedPage(Relation index, BloomBuildState *buildstate)
static void bloomBuildCallback(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state)
bool blinsert(Relation index, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo)
#define InvalidBlockNumber
BloomTuple * BloomFormTuple(BloomState *state, ItemPointer iptr, Datum *values, bool *isnull)
void BloomInitPage(Page page, uint16 flags)
#define BloomPageGetMeta(page)
bool BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple)
Buffer BloomNewBuffer(Relation index)
void BloomInitMetapage(Relation index, ForkNumber forknum)
#define BloomPageIsDeleted(page)
void initBloomState(BloomState *state, Relation index)
#define BLOOM_METAPAGE_BLKNO
static Datum values[MAXATTR]
BlockNumber BufferGetBlockNumber(Buffer buffer)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
#define BUFFER_LOCK_UNLOCK
#define BUFFER_LOCK_SHARE
#define RelationGetNumberOfBlocks(reln)
static Page BufferGetPage(Buffer buffer)
#define BUFFER_LOCK_EXCLUSIVE
static bool PageIsNew(Page page)
#define Assert(condition)
Page GenericXLogRegisterBuffer(GenericXLogState *state, Buffer buffer, int flags)
GenericXLogState * GenericXLogStart(Relation relation)
XLogRecPtr GenericXLogFinish(GenericXLogState *state)
void GenericXLogAbort(GenericXLogState *state)
#define GENERIC_XLOG_FULL_IMAGE
void MemoryContextReset(MemoryContext context)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define CHECK_FOR_INTERRUPTS()
MemoryContextSwitchTo(old_ctx)
#define RelationGetRelationName(relation)
FreeBlockNumberArray notFullPage
static double table_index_build_scan(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, bool allow_sync, bool progress, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)