PostgreSQL Source Code
git master
|
#include "access/htup.h"
#include "access/genam.h"
#include "access/parallel.h"
#include "access/tidstore.h"
#include "catalog/pg_class.h"
#include "catalog/pg_statistic.h"
#include "catalog/pg_type.h"
#include "parser/parse_node.h"
#include "storage/buf.h"
#include "storage/lock.h"
#include "utils/relcache.h"
Go to the source code of this file.
Data Structures | |
struct | VacAttrStats |
struct | VacuumParams |
struct | VacuumCutoffs |
struct | VacDeadItemsInfo |
Macros | |
#define | VACUUM_OPTION_NO_PARALLEL 0 |
#define | VACUUM_OPTION_PARALLEL_BULKDEL (1 << 0) |
#define | VACUUM_OPTION_PARALLEL_COND_CLEANUP (1 << 1) |
#define | VACUUM_OPTION_PARALLEL_CLEANUP (1 << 2) |
#define | VACUUM_OPTION_MAX_VALID_VALUE ((1 << 3) - 1) |
#define | VACOPT_VACUUM 0x01 /* do VACUUM */ |
#define | VACOPT_ANALYZE 0x02 /* do ANALYZE */ |
#define | VACOPT_VERBOSE 0x04 /* output INFO instrumentation messages */ |
#define | VACOPT_FREEZE 0x08 /* FREEZE option */ |
#define | VACOPT_FULL 0x10 /* FULL (non-concurrent) vacuum */ |
#define | VACOPT_SKIP_LOCKED 0x20 /* skip if cannot get lock */ |
#define | VACOPT_PROCESS_MAIN 0x40 /* process main relation */ |
#define | VACOPT_PROCESS_TOAST 0x80 /* process the TOAST table, if any */ |
#define | VACOPT_DISABLE_PAGE_SKIPPING 0x100 /* don't skip any pages */ |
#define | VACOPT_SKIP_DATABASE_STATS 0x200 /* skip vac_update_datfrozenxid() */ |
#define | VACOPT_ONLY_DATABASE_STATS 0x400 /* only vac_update_datfrozenxid() */ |
#define | MAX_STATISTICS_TARGET 10000 |
Typedefs | |
typedef struct ParallelVacuumState | ParallelVacuumState |
typedef struct VacAttrStats * | VacAttrStatsP |
typedef Datum(* | AnalyzeAttrFetchFunc) (VacAttrStatsP stats, int rownum, bool *isNull) |
typedef void(* | AnalyzeAttrComputeStatsFunc) (VacAttrStatsP stats, AnalyzeAttrFetchFunc fetchfunc, int samplerows, double totalrows) |
typedef struct VacAttrStats | VacAttrStats |
typedef enum VacOptValue | VacOptValue |
typedef struct VacuumParams | VacuumParams |
typedef struct VacDeadItemsInfo | VacDeadItemsInfo |
Enumerations | |
enum | VacOptValue { VACOPTVALUE_UNSPECIFIED = 0 , VACOPTVALUE_AUTO , VACOPTVALUE_DISABLED , VACOPTVALUE_ENABLED } |
#define VACOPT_DISABLE_PAGE_SKIPPING 0x100 /* don't skip any pages */ |
#define VACOPT_FULL 0x10 /* FULL (non-concurrent) vacuum */ |
#define VACOPT_ONLY_DATABASE_STATS 0x400 /* only vac_update_datfrozenxid() */ |
#define VACOPT_PROCESS_MAIN 0x40 /* process main relation */ |
#define VACOPT_PROCESS_TOAST 0x80 /* process the TOAST table, if any */ |
#define VACOPT_SKIP_DATABASE_STATS 0x200 /* skip vac_update_datfrozenxid() */ |
typedef void(* AnalyzeAttrComputeStatsFunc) (VacAttrStatsP stats, AnalyzeAttrFetchFunc fetchfunc, int samplerows, double totalrows) |
typedef Datum(* AnalyzeAttrFetchFunc) (VacAttrStatsP stats, int rownum, bool *isNull) |
typedef struct ParallelVacuumState ParallelVacuumState |
typedef struct VacAttrStats VacAttrStats |
typedef struct VacAttrStats* VacAttrStatsP |
typedef struct VacDeadItemsInfo VacDeadItemsInfo |
typedef enum VacOptValue VacOptValue |
typedef struct VacuumParams VacuumParams |
enum VacOptValue |
void analyze_rel | ( | Oid | relid, |
RangeVar * | relation, | ||
VacuumParams * | params, | ||
List * | va_cols, | ||
bool | in_outer_xact, | ||
BufferAccessStrategy | bstrategy | ||
) |
Definition at line 111 of file analyze.c.
References acquire_sample_rows(), FdwRoutine::AnalyzeForeignTable, CHECK_FOR_INTERRUPTS, DEBUG2, do_analyze_rel(), ereport, errmsg(), GetFdwRoutineForRelation(), INFO, VacuumParams::log_min_duration, NoLock, VacuumParams::options, pgstat_progress_end_command(), pgstat_progress_start_command(), PROGRESS_COMMAND_ANALYZE, RelationData::rd_rel, relation_close(), RELATION_IS_OTHER_TEMP, RelationGetNumberOfBlocks, RelationGetRelationName, RelationGetRelid, ShareUpdateExclusiveLock, vac_strategy, VACOPT_VACUUM, VACOPT_VERBOSE, vacuum_is_permitted_for_relation(), vacuum_open_relation(), and WARNING.
Referenced by vacuum().
double anl_get_next_S | ( | double | t, |
int | n, | ||
double * | stateptr | ||
) |
Definition at line 296 of file sampling.c.
double anl_init_selection_state | ( | int | n | ) |
Definition at line 281 of file sampling.c.
double anl_random_fract | ( | void | ) |
Definition at line 266 of file sampling.c.
void AutoVacuumUpdateCostLimit | ( | void | ) |
Definition at line 1704 of file autovacuum.c.
References Assert, autovacuum_vac_cost_limit, AutoVacuumShmem, AutoVacuumShmemStruct::av_nworkersForBalance, av_storage_param_cost_limit, elog, ERROR, Max, MyWorkerInfo, pg_atomic_read_u32(), pg_atomic_unlocked_test_flag(), vacuum_cost_limit, VacuumCostLimit, and WorkerInfoData::wi_dobalance.
Referenced by vacuum_delay_point(), and VacuumUpdateCosts().
void ExecVacuum | ( | ParseState * | pstate, |
VacuumStmt * | vacstmt, | ||
bool | isTopLevel | ||
) |
Definition at line 147 of file vacuum.c.
References _, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, analyze(), DefElem::arg, Assert, BAS_VACUUM, defGetBoolean(), defGetInt32(), defGetString(), DefElem::defname, ereport, errcode(), errhint(), errmsg(), ERROR, VacuumParams::freeze_min_age, VacuumParams::freeze_table_age, get_vacoptval_from_boolean(), GetAccessStrategyWithSize(), GUC_UNIT_KB, VacuumParams::index_cleanup, InvalidOid, VacuumStmt::is_vacuumcmd, VacuumParams::is_wraparound, lfirst, lfirst_node, DefElem::location, VacuumParams::log_min_duration, MAX_BAS_VAC_RING_SIZE_KB, MAX_PARALLEL_WORKER_LIMIT, MemoryContextDelete(), MemoryContextSwitchTo(), MIN_BAS_VAC_RING_SIZE_KB, VacuumParams::multixact_freeze_min_age, VacuumParams::multixact_freeze_table_age, NIL, VacuumParams::nworkers, VacuumParams::options, VacuumStmt::options, parse_int(), parser_errposition(), pg_strcasecmp(), PortalContext, VacuumStmt::rels, VacuumParams::toast_parent, VacuumParams::truncate, VacuumRelation::va_cols, VACOPT_ANALYZE, VACOPT_DISABLE_PAGE_SKIPPING, VACOPT_FREEZE, VACOPT_FULL, VACOPT_ONLY_DATABASE_STATS, VACOPT_PROCESS_MAIN, VACOPT_PROCESS_TOAST, VACOPT_SKIP_DATABASE_STATS, VACOPT_SKIP_LOCKED, VACOPT_VACUUM, VACOPT_VERBOSE, VACOPTVALUE_AUTO, VACOPTVALUE_UNSPECIFIED, vacuum(), VacuumBufferUsageLimit, and verbose.
Referenced by standard_ProcessUtility().
void parallel_vacuum_bulkdel_all_indexes | ( | ParallelVacuumState * | pvs, |
long | num_table_tuples, | ||
int | num_index_scans | ||
) |
Definition at line 501 of file vacuumparallel.c.
References Assert, PVShared::estimated_count, IsParallelWorker, parallel_vacuum_process_all_indexes(), PVShared::reltuples, and ParallelVacuumState::shared.
Referenced by lazy_vacuum_all_indexes().
void parallel_vacuum_cleanup_all_indexes | ( | ParallelVacuumState * | pvs, |
long | num_table_tuples, | ||
int | num_index_scans, | ||
bool | estimated_count | ||
) |
Definition at line 520 of file vacuumparallel.c.
References Assert, PVShared::estimated_count, IsParallelWorker, parallel_vacuum_process_all_indexes(), PVShared::reltuples, and ParallelVacuumState::shared.
Referenced by lazy_cleanup_all_indexes().
void parallel_vacuum_end | ( | ParallelVacuumState * | pvs, |
IndexBulkDeleteResult ** | istats | ||
) |
Definition at line 436 of file vacuumparallel.c.
References Assert, ParallelVacuumState::dead_items, DestroyParallelContext(), ExitParallelMode(), i, ParallelVacuumState::indstats, IsParallelWorker, PVIndStats::istat, PVIndStats::istat_updated, ParallelVacuumState::nindexes, palloc0(), ParallelVacuumState::pcxt, pfree(), TidStoreDestroy(), and ParallelVacuumState::will_parallel_vacuum.
Referenced by dead_items_cleanup().
TidStore* parallel_vacuum_get_dead_items | ( | ParallelVacuumState * | pvs, |
VacDeadItemsInfo ** | dead_items_info_p | ||
) |
Definition at line 467 of file vacuumparallel.c.
References ParallelVacuumState::dead_items, PVShared::dead_items_info, and ParallelVacuumState::shared.
Referenced by dead_items_alloc().
ParallelVacuumState* parallel_vacuum_init | ( | Relation | rel, |
Relation * | indrels, | ||
int | nindexes, | ||
int | nrequested_workers, | ||
int | vac_work_mem, | ||
int | elevel, | ||
BufferAccessStrategy | bstrategy | ||
) |
Definition at line 243 of file vacuumparallel.c.
References PVShared::active_nworkers, IndexAmRoutine::amparallelvacuumoptions, IndexAmRoutine::amusemaintenanceworkmem, Assert, ParallelVacuumState::bstrategy, ParallelVacuumState::buffer_usage, PVShared::cost_balance, CreateParallelContext(), ParallelVacuumState::dead_items, PVShared::dead_items_dsa_handle, PVShared::dead_items_handle, PVShared::dead_items_info, debug_query_string, dsa_get_handle(), PVShared::elevel, EnterParallelMode(), ParallelContext::estimator, GetAccessStrategyBufferCount(), ParallelVacuumState::heaprel, i, PVShared::idx, ParallelVacuumState::indrels, ParallelVacuumState::indstats, InitializeParallelDSM(), LWTRANCHE_PARALLEL_VACUUM_DSA, maintenance_work_mem, PVShared::maintenance_work_mem_worker, VacDeadItemsInfo::max_bytes, MemSet, Min, mul_size(), ParallelVacuumState::nindexes, ParallelVacuumState::nindexes_parallel_bulkdel, ParallelVacuumState::nindexes_parallel_cleanup, ParallelVacuumState::nindexes_parallel_condcleanup, ParallelContext::nworkers, palloc0(), parallel_vacuum_compute_workers(), PARALLEL_VACUUM_KEY_BUFFER_USAGE, PARALLEL_VACUUM_KEY_INDEX_STATS, PARALLEL_VACUUM_KEY_QUERY_TEXT, PARALLEL_VACUUM_KEY_SHARED, PARALLEL_VACUUM_KEY_WAL_USAGE, ParallelVacuumState::pcxt, pfree(), pg_atomic_init_u32(), pgstat_get_my_query_id(), PVShared::queryid, RelationData::rd_indam, RelationGetRelid, PVShared::relid, PVShared::ring_nbuffers, ParallelVacuumState::shared, shm_toc_allocate(), shm_toc_estimate_chunk, shm_toc_estimate_keys, shm_toc_insert(), TidStoreCreateShared(), TidStoreGetDSA(), TidStoreGetHandle(), ParallelContext::toc, VACUUM_OPTION_MAX_VALID_VALUE, VACUUM_OPTION_PARALLEL_BULKDEL, VACUUM_OPTION_PARALLEL_CLEANUP, VACUUM_OPTION_PARALLEL_COND_CLEANUP, ParallelVacuumState::wal_usage, and ParallelVacuumState::will_parallel_vacuum.
Referenced by dead_items_alloc().
void parallel_vacuum_main | ( | dsm_segment * | seg, |
shm_toc * | toc | ||
) |
Definition at line 990 of file vacuumparallel.c.
References PVShared::active_nworkers, ErrorContextCallback::arg, Assert, BAS_VACUUM, ParallelVacuumState::bstrategy, ErrorContextCallback::callback, PVShared::cost_balance, ParallelVacuumState::dead_items, PVShared::dead_items_dsa_handle, PVShared::dead_items_handle, DEBUG1, debug_query_string, elog, error_context_stack, FreeAccessStrategy(), get_namespace_name(), GetAccessStrategyWithSize(), ParallelVacuumState::heaprel, ParallelVacuumState::indname, ParallelVacuumState::indrels, ParallelVacuumState::indstats, InstrEndParallelQuery(), InstrStartParallelQuery(), maintenance_work_mem, PVShared::maintenance_work_mem_worker, MyProc, ParallelVacuumState::nindexes, PARALLEL_INDVAC_STATUS_INITIAL, parallel_vacuum_error_callback(), PARALLEL_VACUUM_KEY_BUFFER_USAGE, PARALLEL_VACUUM_KEY_INDEX_STATS, PARALLEL_VACUUM_KEY_QUERY_TEXT, PARALLEL_VACUUM_KEY_SHARED, PARALLEL_VACUUM_KEY_WAL_USAGE, parallel_vacuum_process_safe_indexes(), ParallelWorkerNumber, pgstat_report_activity(), pgstat_report_query_id(), ErrorContextCallback::previous, PROC_IN_VACUUM, pstrdup(), PVShared::queryid, RelationGetNamespace, RelationGetRelationName, PVShared::relid, ParallelVacuumState::relname, ParallelVacuumState::relnamespace, PVShared::ring_nbuffers, RowExclusiveLock, ParallelVacuumState::shared, ShareUpdateExclusiveLock, shm_toc_lookup(), STATE_RUNNING, ParallelVacuumState::status, PGPROC::statusFlags, table_close(), table_open(), TidStoreAttach(), TidStoreDetach(), vac_close_indexes(), vac_open_indexes(), VacuumActiveNWorkers, VacuumCostBalance, VacuumCostBalanceLocal, VacuumSharedCostBalance, and VacuumUpdateCosts().
void parallel_vacuum_reset_dead_items | ( | ParallelVacuumState * | pvs | ) |
Definition at line 475 of file vacuumparallel.c.
References ParallelVacuumState::dead_items, PVShared::dead_items_dsa_handle, PVShared::dead_items_handle, PVShared::dead_items_info, dsa_get_handle(), LWTRANCHE_PARALLEL_VACUUM_DSA, VacDeadItemsInfo::max_bytes, VacDeadItemsInfo::num_items, ParallelVacuumState::shared, TidStoreCreateShared(), TidStoreDestroy(), TidStoreGetDSA(), and TidStoreGetHandle().
Referenced by dead_items_reset().
bool std_typanalyze | ( | VacAttrStats * | stats | ) |
Definition at line 1872 of file analyze.c.
References VacAttrStats::attrtypid, VacAttrStats::attstattarget, compute_distinct_stats(), compute_scalar_stats(), VacAttrStats::compute_stats, compute_trivial_stats(), default_statistics_target, StdAnalyzeData::eqfunc, StdAnalyzeData::eqopr, VacAttrStats::extra_data, get_opcode(), get_sort_group_operators(), InvalidOid, StdAnalyzeData::ltopr, VacAttrStats::minrows, OidIsValid, and palloc().
Referenced by array_typanalyze(), examine_attribute(), and examine_expression().
IndexBulkDeleteResult* vac_bulkdel_one_index | ( | IndexVacuumInfo * | ivinfo, |
IndexBulkDeleteResult * | istat, | ||
TidStore * | dead_items, | ||
VacDeadItemsInfo * | dead_items_info | ||
) |
Definition at line 2516 of file vacuum.c.
References ereport, errmsg(), IndexVacuumInfo::index, index_bulk_delete(), IndexVacuumInfo::message_level, VacDeadItemsInfo::num_items, RelationGetRelationName, and vac_tid_reaped().
Referenced by lazy_vacuum_one_index(), and parallel_vacuum_process_one_index().
IndexBulkDeleteResult* vac_cleanup_one_index | ( | IndexVacuumInfo * | ivinfo, |
IndexBulkDeleteResult * | istat | ||
) |
Definition at line 2537 of file vacuum.c.
References ereport, errdetail(), errmsg(), IndexVacuumInfo::index, index_vacuum_cleanup(), IndexVacuumInfo::message_level, IndexBulkDeleteResult::num_index_tuples, IndexBulkDeleteResult::num_pages, IndexBulkDeleteResult::pages_deleted, IndexBulkDeleteResult::pages_free, IndexBulkDeleteResult::pages_newly_deleted, RelationGetRelationName, and IndexBulkDeleteResult::tuples_removed.
Referenced by lazy_cleanup_one_index(), and parallel_vacuum_process_one_index().
Definition at line 2341 of file vacuum.c.
References index_close(), and pfree().
Referenced by do_analyze_rel(), heap_vacuum_rel(), and parallel_vacuum_main().
double vac_estimate_reltuples | ( | Relation | relation, |
BlockNumber | total_pages, | ||
BlockNumber | scanned_pages, | ||
double | scanned_tuples | ||
) |
Definition at line 1314 of file vacuum.c.
References RelationData::rd_rel.
Referenced by lazy_scan_heap(), and statapprox_heap().
Definition at line 2298 of file vacuum.c.
References Assert, i, index_close(), index_open(), lfirst_oid, list_free(), list_length(), NoLock, palloc(), RelationData::rd_index, and RelationGetIndexList().
Referenced by do_analyze_rel(), heap_vacuum_rel(), and parallel_vacuum_main().
void vac_update_datfrozenxid | ( | void | ) |
Definition at line 1586 of file vacuum.c.
References AccessShareLock, Assert, BTEqualStrategyNumber, elog, ERROR, ExclusiveLock, ForceTransactionIdLimitUpdate(), FormData_pg_class, GetOldestMultiXactId(), GetOldestNonRemovableTransactionId(), GETSTRUCT, heap_freetuple(), HeapTupleIsValid, InvalidOid, sort-test::key, LockDatabaseFrozenIds(), MultiXactIdIsValid, MultiXactIdPrecedes(), MyDatabaseId, ObjectIdGetDatum(), ReadNextMultiXactId(), ReadNextTransactionId(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), systable_inplace_update_begin(), systable_inplace_update_cancel(), systable_inplace_update_finish(), table_close(), table_open(), TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), and vac_truncate_clog().
Referenced by do_autovacuum(), and vacuum().
void vac_update_relstats | ( | Relation | relation, |
BlockNumber | num_pages, | ||
double | num_tuples, | ||
BlockNumber | num_all_visible_pages, | ||
bool | hasindex, | ||
TransactionId | frozenxid, | ||
MultiXactId | minmulti, | ||
bool * | frozenxid_updated, | ||
bool * | minmulti_updated, | ||
bool | in_outer_xact | ||
) |
Definition at line 1410 of file vacuum.c.
References BTEqualStrategyNumber, elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg_internal(), ERROR, GETSTRUCT, HeapTupleIsValid, sort-test::key, MultiXactIdIsValid, MultiXactIdPrecedes(), ObjectIdGetDatum(), RelationData::rd_rules, ReadNextMultiXactId(), ReadNextTransactionId(), RelationGetRelationName, RelationGetRelid, RowExclusiveLock, ScanKeyInit(), systable_inplace_update_begin(), systable_inplace_update_cancel(), systable_inplace_update_finish(), table_close(), table_open(), TransactionIdIsNormal, TransactionIdPrecedes(), RelationData::trigdesc, and WARNING.
Referenced by do_analyze_rel(), heap_vacuum_rel(), and update_relstats_all_indexes().
void vacuum | ( | List * | relations, |
VacuumParams * | params, | ||
BufferAccessStrategy | bstrategy, | ||
MemoryContext | vac_context, | ||
bool | isTopLevel | ||
) |
Definition at line 478 of file vacuum.c.
References ActiveSnapshotSet(), AmAutoVacuumWorkerProcess, analyze_rel(), Assert, CommandCounterIncrement(), CommitTransactionCommand(), cur, ereport, errcode(), errmsg(), ERROR, expand_vacuum_rel(), get_all_vacuum_rels(), GetTransactionSnapshot(), IsInTransactionBlock(), lfirst_node, list_concat(), list_length(), MemoryContextSwitchTo(), NIL, VacuumRelation::oid, VacuumParams::options, PG_END_TRY, PG_FINALLY, PG_TRY, PopActiveSnapshot(), PreventInTransactionBlock(), PushActiveSnapshot(), VacuumRelation::relation, StartTransactionCommand(), VacuumRelation::va_cols, vac_update_datfrozenxid(), VACOPT_ANALYZE, VACOPT_ONLY_DATABASE_STATS, VACOPT_SKIP_DATABASE_STATS, VACOPT_VACUUM, vacuum_rel(), VacuumActiveNWorkers, VacuumCostActive, VacuumCostBalance, VacuumCostBalanceLocal, VacuumFailsafeActive, VacuumSharedCostBalance, and VacuumUpdateCosts().
Referenced by autovacuum_do_vac_analyze(), ExecVacuum(), parallel_vacuum_index_is_parallel_safe(), and parallel_vacuum_process_all_indexes().
void vacuum_delay_point | ( | void | ) |
Definition at line 2362 of file vacuum.c.
References AmAutoVacuumWorkerProcess, AutoVacuumUpdateCostLimit(), CHECK_FOR_INTERRUPTS, compute_parallel_delay(), ConfigReloadPending, exit(), InterruptPending, IsUnderPostmaster, pg_usleep(), PGC_SIGHUP, pgstat_report_wait_end(), pgstat_report_wait_start(), PostmasterIsAlive, ProcessConfigFile(), vacuum_cost_delay, vacuum_cost_limit, VacuumCostActive, VacuumCostBalance, VacuumSharedCostBalance, and VacuumUpdateCosts().
Referenced by acquire_sample_rows(), blbulkdelete(), blvacuumcleanup(), btvacuumpage(), compute_array_stats(), compute_distinct_stats(), compute_index_stats(), compute_range_stats(), compute_scalar_stats(), compute_trivial_stats(), compute_tsvector_stats(), file_acquire_sample_rows(), ginbulkdelete(), ginInsertCleanup(), ginvacuumcleanup(), gistvacuumpage(), hashbucketcleanup(), lazy_scan_heap(), lazy_vacuum_heap_rel(), spgprocesspending(), and spgvacuumpage().
bool vacuum_get_cutoffs | ( | Relation | rel, |
const VacuumParams * | params, | ||
struct VacuumCutoffs * | cutoffs | ||
) |
Definition at line 1084 of file vacuum.c.
References Assert, autovacuum_freeze_max_age, ereport, errhint(), errmsg(), FirstMultiXactId, FirstNormalTransactionId, VacuumParams::freeze_min_age, VacuumParams::freeze_table_age, VacuumCutoffs::FreezeLimit, GetOldestMultiXactId(), GetOldestNonRemovableTransactionId(), Min, VacuumParams::multixact_freeze_min_age, VacuumParams::multixact_freeze_table_age, VacuumCutoffs::MultiXactCutoff, MultiXactIdIsValid, MultiXactIdPrecedes(), MultiXactIdPrecedesOrEquals(), MultiXactMemberFreezeThreshold(), VacuumCutoffs::OldestMxact, VacuumCutoffs::OldestXmin, RelationData::rd_rel, ReadNextMultiXactId(), ReadNextTransactionId(), VacuumCutoffs::relfrozenxid, VacuumCutoffs::relminmxid, TransactionIdIsNormal, TransactionIdPrecedes(), TransactionIdPrecedesOrEquals(), vacuum_freeze_min_age, vacuum_freeze_table_age, vacuum_multixact_freeze_min_age, vacuum_multixact_freeze_table_age, and WARNING.
Referenced by copy_table_data(), and heap_vacuum_rel().
bool vacuum_is_permitted_for_relation | ( | Oid | relid, |
Form_pg_class | reltuple, | ||
bits32 | options | ||
) |
Definition at line 703 of file vacuum.c.
References ACL_MAINTAIN, ACLCHECK_OK, Assert, ereport, errmsg(), GetUserId(), MyDatabaseId, NameStr, object_ownercheck(), pg_class_aclcheck(), relname, VACOPT_ANALYZE, VACOPT_VACUUM, and WARNING.
Referenced by analyze_rel(), expand_vacuum_rel(), get_all_vacuum_rels(), and vacuum_rel().
Relation vacuum_open_relation | ( | Oid | relid, |
RangeVar * | relation, | ||
bits32 | options, | ||
bool | verbose, | ||
LOCKMODE | lmode | ||
) |
Definition at line 755 of file vacuum.c.
References AmAutoVacuumWorkerProcess, Assert, ConditionalLockRelationOid(), ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errmsg(), LOG, NoLock, RangeVar::relname, try_relation_open(), VACOPT_ANALYZE, VACOPT_SKIP_LOCKED, VACOPT_VACUUM, verbose, and WARNING.
Referenced by analyze_rel(), and vacuum_rel().
bool vacuum_xid_failsafe_check | ( | const struct VacuumCutoffs * | cutoffs | ) |
Definition at line 1252 of file vacuum.c.
References Assert, autovacuum_freeze_max_age, autovacuum_multixact_freeze_max_age, FirstMultiXactId, FirstNormalTransactionId, Max, MultiXactIdIsValid, MultiXactIdPrecedes(), ReadNextMultiXactId(), ReadNextTransactionId(), VacuumCutoffs::relfrozenxid, VacuumCutoffs::relminmxid, TransactionIdIsNormal, TransactionIdPrecedes(), vacuum_failsafe_age, and vacuum_multixact_failsafe_age.
Referenced by lazy_check_wraparound_failsafe().
void VacuumUpdateCosts | ( | void | ) |
Definition at line 1635 of file autovacuum.c.
References Assert, autovacuum_vac_cost_delay, AutoVacuumUpdateCostLimit(), av_storage_param_cost_delay, DEBUG2, elog, LW_SHARED, LWLockAcquire(), LWLockHeldByMe(), LWLockRelease(), message_level_is_interesting(), MyWorkerInfo, pg_atomic_unlocked_test_flag(), vacuum_cost_delay, vacuum_cost_limit, VacuumCostActive, VacuumCostBalance, VacuumCostDelay, VacuumCostLimit, VacuumFailsafeActive, WorkerInfoData::wi_dboid, WorkerInfoData::wi_dobalance, and WorkerInfoData::wi_tableoid.
Referenced by do_autovacuum(), parallel_vacuum_main(), vacuum(), and vacuum_delay_point().
|
extern |
Definition at line 73 of file analyze.c.
Referenced by multirange_typanalyze(), range_typanalyze(), statext_compute_stattarget(), std_typanalyze(), and ts_typanalyze().
|
extern |
Definition at line 80 of file vacuum.c.
Referenced by compute_parallel_delay(), default_reloptions(), vacuum_delay_point(), and VacuumUpdateCosts().
|
extern |
Definition at line 81 of file vacuum.c.
Referenced by AutoVacuumUpdateCostLimit(), compute_parallel_delay(), default_reloptions(), vacuum_delay_point(), and VacuumUpdateCosts().
|
extern |
Definition at line 71 of file vacuum.c.
Referenced by vacuum_xid_failsafe_check().
|
extern |
Definition at line 67 of file vacuum.c.
Referenced by do_autovacuum(), and vacuum_get_cutoffs().
|
extern |
Definition at line 68 of file vacuum.c.
Referenced by do_autovacuum(), and vacuum_get_cutoffs().
|
extern |
Definition at line 72 of file vacuum.c.
Referenced by vacuum_xid_failsafe_check().
|
extern |
Definition at line 69 of file vacuum.c.
Referenced by do_autovacuum(), and vacuum_get_cutoffs().
|
extern |
Definition at line 70 of file vacuum.c.
Referenced by do_autovacuum(), and vacuum_get_cutoffs().
|
extern |
Definition at line 103 of file vacuum.c.
Referenced by compute_parallel_delay(), parallel_vacuum_main(), parallel_vacuum_process_all_indexes(), parallel_vacuum_process_safe_indexes(), parallel_vacuum_process_unsafe_indexes(), and vacuum().
|
extern |
Definition at line 104 of file vacuum.c.
Referenced by compute_parallel_delay(), parallel_vacuum_main(), parallel_vacuum_process_all_indexes(), and vacuum().
|
extern |
Definition at line 96 of file vacuum.c.
Referenced by heap_vacuum_rel(), lazy_check_wraparound_failsafe(), lazy_vacuum(), lazy_vacuum_all_indexes(), should_attempt_truncation(), vacuum(), and VacuumUpdateCosts().
|
extern |
Definition at line 102 of file vacuum.c.
Referenced by compute_parallel_delay(), parallel_vacuum_main(), parallel_vacuum_process_all_indexes(), vacuum(), and vacuum_delay_point().