57#include "utils/fmgroids.h"
70#define PARALLEL_VACUUM_DELAY_REPORT_INTERVAL_NS (NS_PER_S)
149 "vacuum_buffer_usage_limit",
167 bool skip_locked =
false;
171 bool disable_page_skipping =
false;
172 bool process_main =
true;
173 bool process_toast =
true;
175 bool skip_database_stats =
false;
176 bool only_database_stats =
false;
202 if (strcmp(opt->
defname,
"verbose") == 0)
204 else if (strcmp(opt->
defname,
"skip_locked") == 0)
206 else if (strcmp(opt->
defname,
"buffer_usage_limit") == 0)
210 char *vac_buffer_size;
223 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
224 errmsg(
"%s option must be 0 or between %d kB and %d kB",
225 "BUFFER_USAGE_LIMIT",
234 (
errcode(ERRCODE_SYNTAX_ERROR),
239 else if (strcmp(opt->
defname,
"analyze") == 0)
241 else if (strcmp(opt->
defname,
"freeze") == 0)
243 else if (strcmp(opt->
defname,
"full") == 0)
245 else if (strcmp(opt->
defname,
"disable_page_skipping") == 0)
247 else if (strcmp(opt->
defname,
"index_cleanup") == 0)
263 else if (strcmp(opt->
defname,
"process_main") == 0)
265 else if (strcmp(opt->
defname,
"process_toast") == 0)
267 else if (strcmp(opt->
defname,
"truncate") == 0)
269 else if (strcmp(opt->
defname,
"parallel") == 0)
275 (
errcode(ERRCODE_SYNTAX_ERROR),
276 errmsg(
"%s option must be between 0 and %d",
290 else if (strcmp(opt->
defname,
"skip_database_stats") == 0)
292 else if (strcmp(opt->
defname,
"only_database_stats") == 0)
296 (
errcode(ERRCODE_SYNTAX_ERROR),
322 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
323 errmsg(
"VACUUM FULL cannot be performed in parallel")));
333 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
334 errmsg(
"BUFFER_USAGE_LIMIT cannot be specified for VACUUM FULL")));
341 foreach(lc, vacstmt->
rels)
347 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
348 errmsg(
"ANALYZE option must be specified when a column list is provided")));
359 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
360 errmsg(
"VACUUM option DISABLE_PAGE_SKIPPING cannot be used with FULL")));
366 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
367 errmsg(
"PROCESS_TOAST required with VACUUM FULL")));
375 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
376 errmsg(
"ONLY_DATABASE_STATS cannot be specified with a list of tables")));
384 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
385 errmsg(
"ONLY_DATABASE_STATS cannot be specified with other VACUUM options")));
463 vacuum(vacstmt->
rels, params, bstrategy, vac_context, isTopLevel);
495 static bool in_vacuum =
false;
497 const char *stmttype;
498 volatile bool in_outer_xact,
514 in_outer_xact =
false;
526 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
527 errmsg(
"%s cannot be executed from VACUUM or ANALYZE",
539 else if (relations !=
NIL)
544 foreach(lc, relations)
575 use_own_xacts =
true;
580 use_own_xacts =
true;
581 else if (in_outer_xact)
582 use_own_xacts =
false;
584 use_own_xacts =
true;
586 use_own_xacts =
false;
625 foreach(
cur, relations)
649 vrel->
va_cols, in_outer_xact, bstrategy);
732 !reltuple->relisshared) ||
741 (
errmsg(
"permission denied to vacuum \"%s\", skipping it",
754 (
errmsg(
"permission denied to analyze \"%s\", skipping it",
773 bool rel_lock =
true;
810 if (relation == NULL)
831 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
832 errmsg(
"skipping vacuum of \"%s\" --- lock not available",
837 errmsg(
"skipping vacuum of \"%s\" --- relation no longer exists",
852 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
853 errmsg(
"skipping analyze of \"%s\" --- lock not available",
858 errmsg(
"skipping analyze of \"%s\" --- relation no longer exists",
891 vacrels =
lappend(vacrels, vrel);
903 bool include_children;
904 bool is_partitioned_table;
932 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
933 errmsg(
"skipping vacuum of \"%s\" --- lock not available",
937 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
938 errmsg(
"skipping analyze of \"%s\" --- lock not available",
949 elog(
ERROR,
"cache lookup failed for relation %u", relid);
971 is_partitioned_table = (classForm->relkind == RELKIND_PARTITIONED_TABLE);
974 (
errmsg(
"VACUUM ONLY of partitioned table \"%s\" has no effect",
989 if (include_children)
994 foreach(part_lc, part_oids)
998 if (part_oid == relid)
1051 Oid relid = classForm->oid;
1058 if (classForm->relkind != RELKIND_RELATION &&
1059 classForm->relkind != RELKIND_MATVIEW &&
1060 classForm->relkind != RELKIND_PARTITIONED_TABLE)
1102 multixact_freeze_min_age,
1104 multixact_freeze_table_age,
1105 effective_multixact_freeze_max_age;
1108 aggressiveXIDCutoff;
1111 aggressiveMXIDCutoff;
1160 safeOldestMxact = nextMXID - effective_multixact_freeze_max_age;
1165 (
errmsg(
"cutoff for removing and freezing tuples is far in the past"),
1166 errhint(
"Close open transactions soon to avoid wraparound problems.\n"
1167 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1170 (
errmsg(
"cutoff for freezing multixacts is far in the past"),
1171 errhint(
"Close open transactions soon to avoid wraparound problems.\n"
1172 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1180 if (freeze_min_age < 0)
1183 Assert(freeze_min_age >= 0);
1199 if (multixact_freeze_min_age < 0)
1201 multixact_freeze_min_age =
Min(multixact_freeze_min_age,
1202 effective_multixact_freeze_max_age / 2);
1203 Assert(multixact_freeze_min_age >= 0);
1222 if (freeze_table_age < 0)
1225 Assert(freeze_table_age >= 0);
1226 aggressiveXIDCutoff = nextXID - freeze_table_age;
1230 aggressiveXIDCutoff))
1241 if (multixact_freeze_table_age < 0)
1243 multixact_freeze_table_age =
1244 Min(multixact_freeze_table_age,
1245 effective_multixact_freeze_max_age * 0.95);
1246 Assert(multixact_freeze_table_age >= 0);
1247 aggressiveMXIDCutoff = nextMXID - multixact_freeze_table_age;
1251 aggressiveMXIDCutoff))
1272 int skip_index_vacuum;
1331 double scanned_tuples)
1334 double old_rel_tuples = relation->
rd_rel->reltuples;
1336 double unscanned_pages;
1337 double total_tuples;
1340 if (scanned_pages >= total_pages)
1341 return scanned_tuples;
1357 if (old_rel_pages == total_pages &&
1358 scanned_pages < (
double) total_pages * 0.02)
1359 return old_rel_tuples;
1360 if (scanned_pages <= 1)
1361 return old_rel_tuples;
1367 if (old_rel_tuples < 0 || old_rel_pages == 0)
1368 return floor((scanned_tuples / scanned_pages) * total_pages + 0.5);
1376 old_density = old_rel_tuples / old_rel_pages;
1377 unscanned_pages = (double) total_pages - (
double) scanned_pages;
1378 total_tuples = old_density * unscanned_pages + scanned_tuples;
1379 return floor(total_tuples + 0.5);
1430 bool *frozenxid_updated,
bool *minmulti_updated,
1437 void *inplace_state;
1453 NULL, 1,
key, &ctup, &inplace_state);
1455 elog(
ERROR,
"pg_class entry for relid %u vanished during vacuuming",
1462 if (pgcform->relpages != (
int32) num_pages)
1464 pgcform->relpages = (
int32) num_pages;
1467 if (pgcform->reltuples != (
float4) num_tuples)
1469 pgcform->reltuples = (
float4) num_tuples;
1472 if (pgcform->relallvisible != (
int32) num_all_visible_pages)
1474 pgcform->relallvisible = (
int32) num_all_visible_pages;
1477 if (pgcform->relallfrozen != (
int32) num_all_frozen_pages)
1479 pgcform->relallfrozen = (
int32) num_all_frozen_pages;
1490 if (pgcform->relhasindex && !hasindex)
1492 pgcform->relhasindex =
false;
1497 if (pgcform->relhasrules && relation->
rd_rules == NULL)
1499 pgcform->relhasrules =
false;
1502 if (pgcform->relhastriggers && relation->
trigdesc == NULL)
1504 pgcform->relhastriggers =
false;
1519 oldfrozenxid = pgcform->relfrozenxid;
1521 if (frozenxid_updated)
1522 *frozenxid_updated =
false;
1525 bool update =
false;
1530 futurexid = update =
true;
1534 pgcform->relfrozenxid = frozenxid;
1536 if (frozenxid_updated)
1537 *frozenxid_updated =
true;
1542 oldminmulti = pgcform->relminmxid;
1544 if (minmulti_updated)
1545 *minmulti_updated =
false;
1548 bool update =
false;
1553 futuremxid = update =
true;
1557 pgcform->relminmxid = minmulti;
1559 if (minmulti_updated)
1560 *minmulti_updated =
true;
1575 errmsg_internal(
"overwrote invalid relfrozenxid value %u with new value %u for table \"%s\"",
1576 oldfrozenxid, frozenxid,
1581 errmsg_internal(
"overwrote invalid relminmxid value %u with new value %u for table \"%s\"",
1582 oldminmulti, minmulti,
1620 void *inplace_state;
1674 if (classForm->relkind != RELKIND_RELATION &&
1675 classForm->relkind != RELKIND_MATVIEW &&
1676 classForm->relkind != RELKIND_TOASTVALUE)
1711 newFrozenXid = relfrozenxid;
1725 newMinMulti = relminmxid;
1750 Anum_pg_database_oid,
1755 NULL, 1,
key, &tuple, &inplace_state);
1767 if (dbform->datfrozenxid != newFrozenXid &&
1771 dbform->datfrozenxid = newFrozenXid;
1775 newFrozenXid = dbform->datfrozenxid;
1778 if (dbform->datminmxid != newMinMulti &&
1782 dbform->datminmxid = newMinMulti;
1786 newMinMulti = dbform->datminmxid;
1803 lastSaneFrozenXid, lastSaneMinMulti);
1834 Oid oldestxid_datoid;
1835 Oid minmulti_datoid;
1837 bool frozenAlreadyWrapped =
false;
1886 "skipping invalid database \"%s\" while computing relfrozenxid",
1905 frozenAlreadyWrapped =
true;
1909 oldestxid_datoid = dbform->oid;
1915 minmulti_datoid = dbform->oid;
1929 if (frozenAlreadyWrapped)
1932 (
errmsg(
"some databases have not been vacuumed in over 2 billion transactions"),
1933 errdetail(
"You might have already suffered transaction-wraparound data loss.")));
2009 int save_sec_context;
2017 memcpy(&toast_vacuum_params, ¶ms,
sizeof(
VacuumParams));
2117 if (rel->
rd_rel->relkind != RELKIND_RELATION &&
2118 rel->
rd_rel->relkind != RELKIND_MATVIEW &&
2119 rel->
rd_rel->relkind != RELKIND_TOASTVALUE &&
2120 rel->
rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
2123 (
errmsg(
"skipping \"%s\" --- cannot vacuum non-tables or special system tables",
2151 if (rel->
rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
2184 vacuum_index_cleanup =
2193 Assert(vacuum_index_cleanup ==
2199#ifdef USE_INJECTION_POINTS
2227 if (
opts->vacuum_truncate)
2238#ifdef USE_INJECTION_POINTS
2256 toast_relid = rel->
rd_rel->reltoastrelid;
2334 vacuum_rel(toast_relid, NULL, toast_vacuum_params, bstrategy);
2381 foreach(indexoidscan, indexoidlist)
2388 (*Irel)[
i++] = indrel;
2515 last_report_time = delay_end;
2519 else if (is_analyze)
2639 (
errmsg(
"scanned index \"%s\" to remove %" PRId64
" row versions",
2658 (
errmsg(
"index \"%s\" now contains %.0f row versions in %u pages",
2662 errdetail(
"%.0f index row versions were removed.\n"
2663 "%u index pages were newly deleted.\n"
2664 "%u index pages are currently deleted, of which %u are currently reusable.",
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
void AsyncNotifyFreezeXids(TransactionId newFrozenXid)
static uint32 pg_atomic_sub_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 sub_)
static uint32 pg_atomic_add_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 add_)
static uint32 pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
void VacuumUpdateCosts(void)
int autovacuum_multixact_freeze_max_age
int autovacuum_freeze_max_age
void AutoVacuumUpdateCostLimit(void)
void pgstat_progress_parallel_incr_param(int index, int64 incr)
void pgstat_progress_incr_param(int index, int64 incr)
#define MAX_PARALLEL_WORKER_LIMIT
TransactionId MultiXactId
#define OidIsValid(objectId)
void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid)
void cluster_rel(Relation OldHeap, Oid indexOid, ClusterParams *params)
void analyze_rel(Oid relid, RangeVar *relation, const VacuumParams params, List *va_cols, bool in_outer_xact, BufferAccessStrategy bstrategy)
void AdvanceOldestCommitTsXid(TransactionId oldestXact)
void TruncateCommitTs(TransactionId oldestXact)
bool database_is_invalid_form(Form_pg_database datform)
int32 defGetInt32(DefElem *def)
char * defGetString(DefElem *def)
bool defGetBoolean(DefElem *def)
int errmsg_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint_internal(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
BufferAccessStrategy GetAccessStrategyWithSize(BufferAccessStrategyType btype, int ring_size_kb)
void systable_endscan(SysScanDesc sysscan)
void systable_inplace_update_cancel(void *state)
void systable_inplace_update_begin(Relation relation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, const ScanKeyData *key, HeapTuple *oldtupcopy, void **state)
void systable_inplace_update_finish(void *state, HeapTuple tuple)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
volatile sig_atomic_t InterruptPending
int VacuumBufferUsageLimit
void ProcessConfigFile(GucContext context)
bool parse_int(const char *value, int *result, int flags, const char **hintmsg)
int NewGUCNestLevel(void)
void RestrictSearchPath(void)
void AtEOXact_GUC(bool isCommit, int nestLevel)
#define GUC_check_errdetail
Assert(PointerIsAligned(start, uint64))
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
void heap_freetuple(HeapTuple htup)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
#define IsParallelWorker()
IndexBulkDeleteResult * index_vacuum_cleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *istat)
IndexBulkDeleteResult * index_bulk_delete(IndexVacuumInfo *info, IndexBulkDeleteResult *istat, IndexBulkDeleteCallback callback, void *callback_state)
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
#define INJECTION_POINT(name, arg)
#define INSTR_TIME_SET_CURRENT(t)
#define INSTR_TIME_GET_NANOSEC(t)
#define INSTR_TIME_SET_ZERO(t)
#define INSTR_TIME_ACCUM_DIFF(x, y, z)
volatile sig_atomic_t ConfigReloadPending
if(TABLE==NULL||TABLE_index==NULL)
List * lappend(List *list, void *datum)
List * list_concat(List *list1, const List *list2)
void list_free(List *list)
bool ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void LockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode)
void UnlockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode)
void LockDatabaseFrozenIds(LOCKMODE lockmode)
#define AccessExclusiveLock
#define ShareUpdateExclusiveLock
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
VacuumRelation * makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
void pfree(void *pointer)
void MemoryContextDelete(MemoryContext context)
MemoryContext PortalContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define AmAutoVacuumWorkerProcess()
#define MIN_BAS_VAC_RING_SIZE_KB
#define MAX_BAS_VAC_RING_SIZE_KB
#define SECURITY_RESTRICTED_OPERATION
#define CHECK_FOR_INTERRUPTS()
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
void SetUserIdAndSecContext(Oid userid, int sec_context)
bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2)
bool MultiXactIdPrecedesOrEquals(MultiXactId multi1, MultiXactId multi2)
void SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid, bool is_startup)
MultiXactId GetOldestMultiXactId(void)
int MultiXactMemberFreezeThreshold(void)
MultiXactId ReadNextMultiXactId(void)
void TruncateMultiXact(MultiXactId newOldestMulti, Oid newOldestMultiDB)
#define MultiXactIdIsValid(multi)
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
int parser_errposition(ParseState *pstate, int location)
static AmcheckOptions opts
#define ERRCODE_DATA_CORRUPTED
FormData_pg_class * Form_pg_class
TransactionId datfrozenxid
FormData_pg_database * Form_pg_database
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
#define lfirst_node(type, lc)
static int list_length(const List *l)
static rewind_source * source
#define ERRCODE_UNDEFINED_TABLE
#define PostmasterIsAlive()
int pg_strcasecmp(const char *s1, const char *s2)
static Datum ObjectIdGetDatum(Oid X)
#define PROC_VACUUM_FOR_WRAPAROUND
TransactionId GetOldestNonRemovableTransactionId(Relation rel)
#define PROGRESS_VACUUM_DELAY_TIME
#define PROGRESS_ANALYZE_DELAY_TIME
static long analyze(struct nfa *nfa)
#define RelationGetRelid(relation)
#define RelationGetRelationName(relation)
#define RELATION_IS_OTHER_TEMP(relation)
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_OFF
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON
List * RelationGetIndexList(Relation relation)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
void pg_usleep(long microsec)
Snapshot GetTransactionSnapshot(void)
void PushActiveSnapshot(Snapshot snapshot)
bool ActiveSnapshotSet(void)
void PopActiveSnapshot(void)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation try_relation_open(Oid relationId, LOCKMODE lockmode)
#define BTEqualStrategyNumber
BlockNumber pages_deleted
BlockNumber pages_newly_deleted
TransactionId FreezeLimit
TransactionId relfrozenxid
MultiXactId MultiXactCutoff
int log_vacuum_min_duration
int multixact_freeze_min_age
int multixact_freeze_table_age
VacOptValue index_cleanup
int log_analyze_min_duration
double max_eager_freeze_failure_rate
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
static void table_relation_vacuum(Relation rel, const VacuumParams params, BufferAccessStrategy bstrategy)
bool TidStoreIsMember(TidStore *ts, const ItemPointerData *tid)
static TransactionId ReadNextTransactionId(void)
static bool TransactionIdPrecedesOrEquals(TransactionId id1, TransactionId id2)
#define FirstNormalTransactionId
#define TransactionIdIsValid(xid)
#define TransactionIdIsNormal(xid)
static bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
static bool vac_tid_reaped(ItemPointer itemptr, void *state)
void ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
pg_atomic_uint32 * VacuumActiveNWorkers
static void vac_truncate_clog(TransactionId frozenXID, MultiXactId minMulti, TransactionId lastSaneFrozenXid, MultiXactId lastSaneMinMulti)
void vacuum(List *relations, const VacuumParams params, BufferAccessStrategy bstrategy, MemoryContext vac_context, bool isTopLevel)
int vacuum_freeze_min_age
double vacuum_max_eager_freeze_failure_rate
bool track_cost_delay_timing
static List * expand_vacuum_rel(VacuumRelation *vrel, MemoryContext vac_context, int options)
static double compute_parallel_delay(void)
static VacOptValue get_vacoptval_from_boolean(DefElem *def)
void vac_open_indexes(Relation relation, LOCKMODE lockmode, int *nindexes, Relation **Irel)
#define PARALLEL_VACUUM_DELAY_REPORT_INTERVAL_NS
bool check_vacuum_buffer_usage_limit(int *newval, void **extra, GucSource source)
int VacuumCostBalanceLocal
static List * get_all_vacuum_rels(MemoryContext vac_context, int options)
int vacuum_multixact_freeze_table_age
int vacuum_freeze_table_age
IndexBulkDeleteResult * vac_cleanup_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat)
int vacuum_multixact_failsafe_age
int vacuum_multixact_freeze_min_age
Relation vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options, bool verbose, LOCKMODE lmode)
int64 parallel_vacuum_worker_delay_ns
void vac_close_indexes(int nindexes, Relation *Irel, LOCKMODE lockmode)
void vac_update_datfrozenxid(void)
void vacuum_delay_point(bool is_analyze)
bool vacuum_xid_failsafe_check(const struct VacuumCutoffs *cutoffs)
pg_atomic_uint32 * VacuumSharedCostBalance
bool VacuumFailsafeActive
double vac_estimate_reltuples(Relation relation, BlockNumber total_pages, BlockNumber scanned_pages, double scanned_tuples)
bool vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple, bits32 options)
static bool vacuum_rel(Oid relid, RangeVar *relation, VacuumParams params, BufferAccessStrategy bstrategy)
void vac_update_relstats(Relation relation, BlockNumber num_pages, double num_tuples, BlockNumber num_all_visible_pages, BlockNumber num_all_frozen_pages, bool hasindex, TransactionId frozenxid, MultiXactId minmulti, bool *frozenxid_updated, bool *minmulti_updated, bool in_outer_xact)
bool vacuum_get_cutoffs(Relation rel, const VacuumParams params, struct VacuumCutoffs *cutoffs)
IndexBulkDeleteResult * vac_bulkdel_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat, TidStore *dead_items, VacDeadItemsInfo *dead_items_info)
#define VACOPT_SKIP_LOCKED
#define VACOPT_SKIP_DATABASE_STATS
@ VACOPTVALUE_UNSPECIFIED
#define VACOPT_PROCESS_TOAST
#define VACOPT_DISABLE_PAGE_SKIPPING
#define VACOPT_ONLY_DATABASE_STATS
#define VACOPT_PROCESS_MAIN
void SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
bool ForceTransactionIdLimitUpdate(void)
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)
bool IsInTransactionBlock(bool isTopLevel)
void CommandCounterIncrement(void)
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
void StartTransactionCommand(void)
void CommitTransactionCommand(void)