44 bool *isnull,
bool tupleIsAlive,
void *
state)
85 elog(
ERROR,
"index \"%s\" already contains data",
123 "SP-GiST build temporary context",
173 (
char *) page,
true);
182 (
char *) page,
true);
191 (
char *) page,
true);
218 "SP-GiST insert temporary context",
230 while (!
spgdoinsert(index, &spgstate, ht_ctid, *values, *isnull))
static void spgistBuildCallback(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state)
void SpGistUpdateMetaPage(Relation index)
bool spgdoinsert(Relation index, SpGistState *state, ItemPointer heapPtr, Datum datum, bool isnull)
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
void MarkBufferDirty(Buffer buffer)
bool spginsert(Relation index, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo)
struct SMgrRelationData * rd_smgr
#define END_CRIT_SECTION()
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#define START_CRIT_SECTION()
void MemoryContextReset(MemoryContext context)
#define SPGIST_ROOT_BLKNO
void UnlockReleaseBuffer(Buffer buffer)
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)
#define ALLOCSET_DEFAULT_SIZES
RelFileNodeBackend smgr_rnode
#define SPGIST_NULL_BLKNO
void smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, char *buffer, bool skipFsync)
#define SPGIST_METAPAGE_BLKNO
void initSpGistState(SpGistState *state, Relation index)
#define RelationGetRelationName(relation)
MemoryContext CurrentMemoryContext
void spgbuildempty(Relation index)
void SpGistInitBuffer(Buffer b, uint16 f)
#define BufferGetPage(buffer)
void * palloc0(Size size)
#define RelationGetNumberOfBlocks(reln)
Buffer SpGistNewBuffer(Relation index)
#define Assert(condition)
void SpGistInitMetapage(Page page)
void PageSetChecksumInplace(Page page, BlockNumber blkno)
#define RelationNeedsWAL(relation)
IndexBuildResult * spgbuild(Relation heap, Relation index, IndexInfo *indexInfo)
static Datum values[MAXATTR]
void log_newpage_range(Relation rel, ForkNumber forkNum, BlockNumber startblk, BlockNumber endblk, bool page_std)
BlockNumber BufferGetBlockNumber(Buffer buffer)
void SpGistInitPage(Page page, uint16 f)
XLogRecPtr log_newpage(RelFileNode *rnode, ForkNumber forkNum, BlockNumber blkno, Page page, bool page_std)
void smgrimmedsync(SMgrRelation reln, ForkNumber forknum)