48 int nitem,
int *nremaining)
57 for (
i = 0;
i < nitem;
i++)
169 #ifdef USE_ASSERT_CHECKING
215 data.parentOffset = myoff;
252 bool meDelete =
false;
349 bool hasVoidPage =
false;
483 bool free_items_orig;
490 free_items_orig =
true;
496 free_items_orig =
false;
529 if (tmppage == origpage)
544 (
char *) plist, plistsize,
551 elog(
ERROR,
"failed to add item to index page in \"%s\"",
560 return (tmppage == origpage) ? NULL : tmppage;
575 "Gin vacuum temporary context",
667 for (
i = 0;
i < nRoot;
i++)
723 memset(&idxStat, 0,
sizeof(idxStat));
#define InvalidBlockNumber
BlockNumber BufferGetBlockNumber(Buffer buffer)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void MarkBufferDirty(Buffer buffer)
void LockBufferForCleanup(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)
static bool BufferIsValid(Buffer bufnum)
void PageRestoreTempPage(Page tempPage, Page oldPage)
void PageIndexTupleDelete(Page page, OffsetNumber offnum)
Page PageGetTempPageCopy(Page page)
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 PageAddItem(page, item, size, offsetNumber, overwrite, is_heap)
#define Assert(condition)
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
#define GinPageGetDeleteXid(page)
#define GinIsPostingTree(itup)
#define GinPageGetOpaque(page)
#define GinGetPosting(itup)
#define SizeOfGinPostingList(plist)
#define GinPageSetDeleteXid(page, xid)
#define GinPageIsList(page)
#define GinGetDownlink(itup)
#define GinItupIsCompressed(itup)
#define GinGetNPosting(itup)
#define GinPageIsData(page)
signed char GinNullCategory
#define GinPageRightMost(page)
#define GinDataPageGetPostingItem(page, i)
#define PostingItemGetBlockNumber(pointer)
#define GinDataLeafPageIsEmpty(page)
#define GinPageIsDeleted(page)
#define GinPageSetDeleted(page)
#define GinPageIsLeaf(page)
void GinPageDeletePostingItem(Page page, OffsetNumber offset)
void ginVacuumPostingTreeLeaf(Relation indexrel, Buffer buffer, GinVacuumState *gvs)
IndexTuple GinFormTuple(GinState *ginstate, OffsetNumber attnum, Datum key, GinNullCategory category, Pointer data, Size dataSize, int nipd, bool errorTooBig)
void ginInsertCleanup(GinState *ginstate, bool full_clean, bool fill_fsm, bool forceCleanup, IndexBulkDeleteResult *stats)
GinPostingList * ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize, int *nwritten)
ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded_out)
OffsetNumber gintuple_get_attrnum(GinState *ginstate, IndexTuple tuple)
Datum gintuple_get_key(GinState *ginstate, IndexTuple tuple, GinNullCategory *category)
void initGinState(GinState *state, Relation index)
void ginUpdateStats(Relation index, const GinStatsData *stats, bool is_build)
struct DataPageDeleteStack DataPageDeleteStack
IndexBulkDeleteResult * ginbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
static bool ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno)
static void xlogVacuumPage(Relation index, Buffer buffer)
ItemPointer ginVacuumItemPointers(GinVacuumState *gvs, ItemPointerData *items, int nitem, int *nremaining)
bool GinPageIsRecyclable(Page page)
static void ginVacuumPostingTree(GinVacuumState *gvs, BlockNumber rootBlkno)
IndexBulkDeleteResult * ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
static void ginDeletePage(GinVacuumState *gvs, BlockNumber deleteBlkno, BlockNumber leftBlkno, BlockNumber parentBlkno, OffsetNumber myoff, bool isParentRoot)
static Page ginVacuumEntryPage(GinVacuumState *gvs, Buffer buffer, BlockNumber *roots, uint32 *nroot)
static bool ginScanToDelete(GinVacuumState *gvs, BlockNumber blkno, bool isRoot, DataPageDeleteStack *parent, OffsetNumber myoff)
#define XLOG_GIN_VACUUM_PAGE
#define XLOG_GIN_DELETE_PAGE
void IndexFreeSpaceMapVacuum(Relation rel)
void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock)
ItemPointerData * ItemPointer
IndexTupleData * IndexTuple
#define IndexTupleSize(itup)
struct IndexTupleData IndexTupleData
void LockRelationForExtension(Relation relation, LOCKMODE lockmode)
void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode)
void MemoryContextReset(MemoryContext context)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define AmAutoVacuumWorkerProcess()
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define InvalidOffsetNumber
#define FirstOffsetNumber
void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno)
bool GlobalVisCheckRemovableXid(Relation rel, TransactionId xid)
MemoryContextSwitchTo(old_ctx)
#define RELATION_IS_LOCAL(relation)
#define RelationGetRelationName(relation)
#define RelationNeedsWAL(relation)
struct DataPageDeleteStack * parent
struct DataPageDeleteStack * child
BufferAccessStrategy strategy
IndexBulkDeleteCallback callback
IndexBulkDeleteResult * result
BlockNumber pages_deleted
BlockNumber pages_newly_deleted
BufferAccessStrategy strategy
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
static TransactionId ReadNextTransactionId(void)
#define TransactionIdIsValid(xid)
void vacuum_delay_point(void)
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