PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/gin_private.h"
#include "access/ginxlog.h"
#include "access/xloginsert.h"
#include "commands/vacuum.h"
#include "miscadmin.h"
#include "storage/indexfsm.h"
#include "storage/lmgr.h"
#include "storage/predicate.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | GinVacuumState |
struct | DataPageDeleteStack |
Typedefs | |
typedef struct DataPageDeleteStack | DataPageDeleteStack |
typedef struct DataPageDeleteStack DataPageDeleteStack |
IndexBulkDeleteResult* ginbulkdelete | ( | IndexVacuumInfo * | info, |
IndexBulkDeleteResult * | stats, | ||
IndexBulkDeleteCallback | callback, | ||
void * | callback_state | ||
) |
Definition at line 564 of file ginvacuum.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AmAutoVacuumWorkerProcess, Assert, DataPageDeleteStack::blkno, BufferGetPage(), GinVacuumState::callback, callback(), GinVacuumState::callback_state, CurrentMemoryContext, END_CRIT_SECTION, FirstOffsetNumber, GIN_EXCLUSIVE, GIN_ROOT_BLKNO, GIN_SHARE, GIN_UNLOCK, GinGetDownlink, ginInsertCleanup(), GinPageGetOpaque, GinPageIsData, GinPageIsLeaf, GinVacuumState::ginstate, ginVacuumEntryPage(), ginVacuumPostingTree(), i, GinVacuumState::index, IndexVacuumInfo::index, initGinState(), InvalidBlockNumber, LockBuffer(), MAIN_FORKNUM, MarkBufferDirty(), MemoryContextDelete(), IndexBulkDeleteResult::num_index_tuples, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageRestoreTempPage(), palloc0(), RBM_NORMAL, ReadBufferExtended(), GinVacuumState::result, START_CRIT_SECTION, GinVacuumState::strategy, IndexVacuumInfo::strategy, GinVacuumState::tmpCxt, UnlockReleaseBuffer(), vacuum_delay_point(), and xlogVacuumPage().
Referenced by ginhandler().
|
static |
Definition at line 129 of file ginvacuum.c.
References Assert, BufferGetPage(), data, END_CRIT_SECTION, GinDataPageGetPostingItem, GinPageDeletePostingItem(), GinPageGetDeleteXid, GinPageGetOpaque, GinPageSetDeleted, GinPageSetDeleteXid, GinVacuumState::index, MAIN_FORKNUM, MarkBufferDirty(), IndexBulkDeleteResult::pages_deleted, IndexBulkDeleteResult::pages_newly_deleted, PageSetLSN(), PostingItemGetBlockNumber, PredicateLockPageCombine(), RBM_NORMAL, ReadBufferExtended(), ReadNextTransactionId(), REGBUF_STANDARD, RelationNeedsWAL, ReleaseBuffer(), GinVacuumState::result, START_CRIT_SECTION, GinVacuumState::strategy, XLOG_GIN_DELETE_PAGE, XLogBeginInsert(), XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by ginScanToDelete().
bool GinPageIsRecyclable | ( | Page | page | ) |
Definition at line 801 of file ginvacuum.c.
References GinPageGetDeleteXid, GinPageIsDeleted, GlobalVisCheckRemovableXid(), PageIsNew(), and TransactionIdIsValid.
Referenced by GinNewBuffer(), and ginvacuumcleanup().
|
static |
Definition at line 246 of file ginvacuum.c.
References Assert, DataPageDeleteStack::blkno, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), DataPageDeleteStack::child, FirstOffsetNumber, GIN_EXCLUSIVE, GIN_UNLOCK, GinDataLeafPageIsEmpty, GinDataPageGetPostingItem, ginDeletePage(), GinPageGetOpaque, GinPageIsData, GinPageIsLeaf, GinPageRightMost, i, GinVacuumState::index, InvalidBuffer, DataPageDeleteStack::isRoot, DataPageDeleteStack::leftBuffer, LockBuffer(), MAIN_FORKNUM, palloc0(), DataPageDeleteStack::parent, PostingItemGetBlockNumber, RBM_NORMAL, ReadBufferExtended(), ReleaseBuffer(), GinVacuumState::strategy, and UnlockReleaseBuffer().
Referenced by ginVacuumPostingTree().
IndexBulkDeleteResult* ginvacuumcleanup | ( | IndexVacuumInfo * | info, |
IndexBulkDeleteResult * | stats | ||
) |
Definition at line 687 of file ginvacuum.c.
References AmAutoVacuumWorkerProcess, IndexVacuumInfo::analyze_only, Assert, DataPageDeleteStack::blkno, BufferGetPage(), IndexVacuumInfo::estimated_count, IndexBulkDeleteResult::estimated_count, ExclusiveLock, GIN_ROOT_BLKNO, GIN_SHARE, ginInsertCleanup(), GinPageIsData, GinPageIsLeaf, GinPageIsList, GinPageIsRecyclable(), ginUpdateStats(), IndexVacuumInfo::index, IndexFreeSpaceMapVacuum(), initGinState(), LockBuffer(), LockRelationForExtension(), MAIN_FORKNUM, Max, GinStatsData::nDataPages, GinStatsData::nEntries, GinStatsData::nEntryPages, GinStatsData::nTotalPages, IndexVacuumInfo::num_heap_tuples, IndexBulkDeleteResult::num_index_tuples, IndexBulkDeleteResult::num_pages, PageGetMaxOffsetNumber(), IndexBulkDeleteResult::pages_free, palloc0(), RBM_NORMAL, ReadBufferExtended(), RecordFreeIndexPage(), RELATION_IS_LOCAL, RelationGetNumberOfBlocks, IndexVacuumInfo::strategy, UnlockRelationForExtension(), UnlockReleaseBuffer(), and vacuum_delay_point().
Referenced by ginhandler().
|
static |
Definition at line 455 of file ginvacuum.c.
References attnum, BufferGetPage(), elog, ERROR, FirstOffsetNumber, ginCompressPostingList(), GinFormTuple(), GinGetDownlink, GinGetNPosting, GinGetPosting, GinIsPostingTree, GinItupIsCompressed, GinMaxItemSize, ginPostingListDecode(), GinVacuumState::ginstate, gintuple_get_attrnum(), gintuple_get_key(), ginVacuumItemPointers(), i, GinVacuumState::index, IndexTupleSize, items, sort-test::key, nitems, PageAddItem, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageGetTempPageCopy(), PageIndexTupleDelete(), pfree(), RelationGetRelationName, and SizeOfGinPostingList.
Referenced by ginbulkdelete().
ItemPointer ginVacuumItemPointers | ( | GinVacuumState * | gvs, |
ItemPointerData * | items, | ||
int | nitem, | ||
int * | nremaining | ||
) |
Definition at line 47 of file ginvacuum.c.
References GinVacuumState::callback, GinVacuumState::callback_state, i, items, IndexBulkDeleteResult::num_index_tuples, palloc(), remaining, GinVacuumState::result, and IndexBulkDeleteResult::tuples_removed.
Referenced by ginVacuumEntryPage(), and ginVacuumPostingTreeLeaf().
|
static |
Definition at line 408 of file ginvacuum.c.
References DataPageDeleteStack::child, ginScanToDelete(), ginVacuumPostingTreeLeaves(), GinVacuumState::index, InvalidBuffer, InvalidOffsetNumber, LockBufferForCleanup(), MAIN_FORKNUM, pfree(), RBM_NORMAL, ReadBufferExtended(), root, GinVacuumState::strategy, and UnlockReleaseBuffer().
Referenced by ginbulkdelete().
|
static |
Definition at line 345 of file ginvacuum.c.
References Assert, DataPageDeleteStack::blkno, BufferGetPage(), FirstOffsetNumber, GIN_EXCLUSIVE, GIN_SHARE, GIN_UNLOCK, GinDataLeafPageIsEmpty, GinDataPageGetPostingItem, GinPageGetOpaque, GinPageIsData, GinPageIsLeaf, ginVacuumPostingTreeLeaf(), GinVacuumState::index, InvalidBlockNumber, LockBuffer(), MAIN_FORKNUM, MemoryContextReset(), MemoryContextSwitchTo(), PageGetMaxOffsetNumber(), PostingItemGetBlockNumber, RBM_NORMAL, ReadBufferExtended(), GinVacuumState::strategy, GinVacuumState::tmpCxt, and UnlockReleaseBuffer().
Referenced by ginVacuumPostingTree().
Definition at line 89 of file ginvacuum.c.
References Assert, BufferGetPage(), GinPageIsData, GinPageIsLeaf, PageSetLSN(), REGBUF_FORCE_IMAGE, REGBUF_STANDARD, RelationNeedsWAL, XLOG_GIN_VACUUM_PAGE, XLogBeginInsert(), XLogInsert(), and XLogRegisterBuffer().
Referenced by ginbulkdelete().