167 "GiST VACUUM page set context",
178 vstate.
stats = stats;
222 if (blkno >= num_pages)
225 for (; blkno < num_pages; blkno++)
352 todelete[ntodelete++] = off;
399 if (blkno == orig_blkno)
426 (
errmsg(
"index \"%s\" contains an inner tuple marked as invalid",
428 errdetail(
"This is caused by an incomplete page split at crash recovery before upgrading to PostgreSQL 9.1."),
429 errhint(
"Please REINDEX it.")));
437 if (blkno == orig_blkno)
472 while (empty_pages_remaining > 0 &&
508 off <= maxoff && ntodelete < maxoff - 1;
518 leafs_to_delete[ntodelete] = leafblk;
519 todelete[ntodelete++] = off;
539 for (
int i = 0;
i < ntodelete;
i++)
557 buffer, todelete[
i] - deleted,
571 empty_pages_remaining -= ntodelete;
#define InvalidBlockNumber
BlockNumber BufferGetBlockNumber(Buffer buffer)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void MarkBufferDirty(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
#define RelationGetNumberOfBlocks(reln)
static Page BufferGetPage(Buffer buffer)
void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
void PageIndexTupleDelete(Page page, OffsetNumber offnum)
static Item PageGetItem(Page page, ItemId itemId)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static bool PageIsNew(Page page)
static void PageSetLSN(Page page, XLogRecPtr lsn)
static OffsetNumber PageGetMaxOffsetNumber(Page page)
#define Assert(condition)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
MemoryContext GenerationContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize)
#define GistPageIsLeaf(page)
static void GistPageSetDeleted(Page page, FullTransactionId deletexid)
#define GistMarkTuplesDeleted(page)
#define GistFollowRight(page)
#define GistPageIsDeleted(page)
#define GistPageGetOpaque(page)
#define GistPageGetNSN(page)
#define GistTupleIsInvalid(itup)
bool gistPageRecyclable(Page page)
XLogRecPtr gistGetFakeLSN(Relation rel)
void gistcheckpage(Relation rel, Buffer buf)
static void gistvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno, BlockNumber orig_blkno)
IndexBulkDeleteResult * gistvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
static bool gistdeletepage(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, Buffer parentBuffer, OffsetNumber downlink, Buffer leafBuffer)
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info, GistVacState *vstate)
IndexBulkDeleteResult * gistbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
XLogRecPtr gistXLogPageDelete(Buffer buffer, FullTransactionId xid, Buffer parentBuffer, OffsetNumber downlinkOffset)
XLogRecPtr gistXLogUpdate(Buffer buffer, OffsetNumber *todelete, int ntodelete, IndexTuple *itup, int ituplen, Buffer leftchildbuf)
void IndexFreeSpaceMapVacuum(Relation rel)
void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock)
uint64 intset_num_entries(IntegerSet *intset)
bool intset_is_member(IntegerSet *intset, uint64 x)
void intset_begin_iterate(IntegerSet *intset)
bool intset_iterate_next(IntegerSet *intset, uint64 *next)
IntegerSet * intset_create(void)
void intset_add_member(IntegerSet *intset, uint64 x)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
IndexTupleData * IndexTuple
void LockRelationForExtension(Relation relation, LOCKMODE lockmode)
void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define InvalidOffsetNumber
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
MemoryContextSwitchTo(old_ctx)
#define RELATION_IS_LOCAL(relation)
#define RelationGetRelationName(relation)
#define RelationNeedsWAL(relation)
MemoryContext page_set_context
IndexBulkDeleteCallback callback
IndexBulkDeleteResult * stats
IntegerSet * empty_leaf_set
IntegerSet * internal_page_set
BlockNumber pages_deleted
BlockNumber pages_newly_deleted
BufferAccessStrategy strategy
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
void vacuum_delay_point(void)
FullTransactionId ReadNextFullTransactionId(void)
XLogRecPtr GetInsertRecPtr(void)