70 while (*listLink != NULL)
75 listLink = &pitem->
next;
94 for (pitem = bds->
pendingList; pitem != NULL; pitem = nitem)
142 memset(predecessor, 0,
sizeof(predecessor));
143 memset(deletable, 0,
sizeof(deletable));
176 elog(
ERROR,
"inconsistent tuple chain links in page %u of index \"%s\"",
238 bool interveningDeletable;
246 if (predecessor[
i] != 0)
250 interveningDeletable =
false;
264 elog(
ERROR,
"unexpected SPGiST tuple state: %d",
274 interveningDeletable =
true;
283 moveDest[xlrec.
nMove] =
i;
287 interveningDeletable =
false;
295 if (interveningDeletable)
297 chainSrc[xlrec.
nChain] = prevLive;
302 interveningDeletable =
false;
314 else if (interveningDeletable)
317 chainSrc[xlrec.
nChain] = prevLive;
325 elog(
ERROR,
"inconsistent counts of deletable tuples");
359 moveSrc, xlrec.
nMove,
443 elog(
ERROR,
"unexpected SPGiST tuple state: %d",
500 bool hasNonPlaceholder =
false;
501 bool hasUpdate =
false;
560 if (!hasNonPlaceholder)
561 firstPlaceholder =
i;
565 hasNonPlaceholder =
true;
579 for (
i = firstPlaceholder;
i <= max;
i++)
580 itemnos[
i - firstPlaceholder] =
i;
582 i = max - firstPlaceholder + 1;
725 elog(
ERROR,
"redirection leads to root page of index \"%s\"",
741 for (nitem = pitem->
next; nitem != NULL; nitem = nitem->
next)
756 for (nitem = pitem; nitem != NULL; nitem = nitem->
next)
786 elog(
ERROR,
"unexpected SPGiST tuple state: %d",
847 if (blkno >= num_pages)
850 for (; blkno < num_pages; blkno++)
#define InvalidBlockNumber
BlockNumber BufferGetBlockNumber(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)
#define BUFFER_LOCK_EXCLUSIVE
void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
static bool PageIsEmpty(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 Assert(condition)
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
void IndexFreeSpaceMapVacuum(Relation rel)
void RecordFreeIndexPage(Relation rel, BlockNumber freeBlock)
bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
static bool ItemPointerIsValid(const ItemPointerData *pointer)
#define MaxIndexTuplesPerPage
void LockRelationForExtension(Relation relation, LOCKMODE lockmode)
void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode)
void pfree(void *pointer)
void * palloc0(Size size)
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
#define InvalidOffsetNumber
#define FirstOffsetNumber
bool GlobalVisTestIsRemovableXid(GlobalVisState *state, TransactionId xid)
GlobalVisState * GlobalVisTestFor(Relation rel)
#define RELATION_IS_LOCAL(relation)
#define RelationGetRelationName(relation)
#define RelationIsAccessibleInLogicalDecoding(relation)
#define RelationNeedsWAL(relation)
Snapshot GetActiveSnapshot(void)
void spgPageIndexMultiDelete(SpGistState *state, Page page, OffsetNumber *itemnos, int nitems, int firststate, int reststate, BlockNumber blkno, OffsetNumber offnum)
SpGistDeadTupleData * SpGistDeadTuple
SpGistInnerTupleData * SpGistInnerTuple
#define SGLT_GET_NEXTOFFSET(spgLeafTuple)
#define SPGIST_PLACEHOLDER
#define SGITITERATE(x, i, nt)
#define SpGistPageIsLeaf(page)
#define SPGIST_METAPAGE_BLKNO
#define SpGistPageIsDeleted(page)
#define SGLT_SET_NEXTOFFSET(spgLeafTuple, offsetNumber)
#define SpGistBlockIsRoot(blkno)
struct SpGistLeafTupleData * SpGistLeafTuple
#define STORE_STATE(s, d)
#define SpGistPageGetOpaque(page)
#define SPGIST_LAST_FIXED_BLKNO
void initSpGistState(SpGistState *state, Relation index)
void SpGistUpdateMetaPage(Relation index)
void SpGistSetLastUsedPage(Relation index, Buffer buffer)
struct spgBulkDeleteState spgBulkDeleteState
static void vacuumRedirectAndPlaceholder(Relation index, Relation heaprel, Buffer buffer)
static bool dummy_callback(ItemPointer itemptr, void *state)
struct spgVacPendingItem spgVacPendingItem
IndexBulkDeleteResult * spgvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
static void vacuumLeafPage(spgBulkDeleteState *bds, Relation index, Buffer buffer, bool forPending)
static void spgvacuumscan(spgBulkDeleteState *bds)
static void spgprocesspending(spgBulkDeleteState *bds)
IndexBulkDeleteResult * spgbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
static void vacuumLeafRoot(spgBulkDeleteState *bds, Relation index, Buffer buffer)
static void spgClearPendingList(spgBulkDeleteState *bds)
static void spgvacuumpage(spgBulkDeleteState *bds, BlockNumber blkno)
static void spgAddPendingTID(spgBulkDeleteState *bds, ItemPointer tid)
#define XLOG_SPGIST_VACUUM_ROOT
#define SizeOfSpgxlogVacuumLeaf
#define SizeOfSpgxlogVacuumRedirect
#define XLOG_SPGIST_VACUUM_LEAF
#define XLOG_SPGIST_VACUUM_REDIRECT
#define SizeOfSpgxlogVacuumRoot
void RelationTruncate(Relation rel, BlockNumber nblocks)
BlockNumber pages_deleted
BlockNumber pages_newly_deleted
BufferAccessStrategy strategy
IndexBulkDeleteResult * stats
IndexBulkDeleteCallback callback
spgVacPendingItem * pendingList
BlockNumber lastFilledBlock
struct spgVacPendingItem * next
OffsetNumber firstPlaceholder
TransactionId snapshotConflictHorizon
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
bool TransactionIdFollowsOrEquals(TransactionId id1, TransactionId id2)
#define InvalidTransactionId
#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)