PostgreSQL Source Code
git master
|
#include "access/htup.h"
#include "access/genam.h"
#include "access/parallel.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 | VacDeadItems |
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 | MAXDEADITEMS(avail_mem) (((avail_mem) - offsetof(VacDeadItems, items)) / sizeof(ItemPointerData)) |
#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 VacDeadItems | VacDeadItems |
Enumerations | |
enum | VacOptValue { VACOPTVALUE_UNSPECIFIED = 0 , VACOPTVALUE_AUTO , VACOPTVALUE_DISABLED , VACOPTVALUE_ENABLED } |
#define MAXDEADITEMS | ( | avail_mem | ) | (((avail_mem) - offsetof(VacDeadItems, items)) / sizeof(ItemPointerData)) |
#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 VacDeadItems VacDeadItems |
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 121 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_ANALYZE, VACOPT_VACUUM, VACOPT_VERBOSE, vacuum_is_relation_owner(), 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 1855 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 150 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, 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::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 469 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 488 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 433 of file vacuumparallel.c.
References Assert(), DestroyParallelContext(), ExitParallelMode(), i, ParallelVacuumState::indstats, IsParallelWorker, PVIndStats::istat, PVIndStats::istat_updated, ParallelVacuumState::nindexes, palloc0(), ParallelVacuumState::pcxt, pfree(), and ParallelVacuumState::will_parallel_vacuum.
Referenced by dead_items_cleanup().
VacDeadItems* parallel_vacuum_get_dead_items | ( | ParallelVacuumState * | pvs | ) |
Definition at line 460 of file vacuumparallel.c.
References ParallelVacuumState::dead_items.
Referenced by dead_items_alloc().
ParallelVacuumState* parallel_vacuum_init | ( | Relation | rel, |
Relation * | indrels, | ||
int | nindexes, | ||
int | nrequested_workers, | ||
int | max_items, | ||
int | elevel, | ||
BufferAccessStrategy | bstrategy | ||
) |
Definition at line 234 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, debug_query_string, PVShared::elevel, EnterParallelMode(), ParallelContext::estimator, GetAccessStrategyBufferCount(), ParallelVacuumState::heaprel, i, PVShared::idx, ParallelVacuumState::indrels, ParallelVacuumState::indstats, InitializeParallelDSM(), VacDeadItems::items, maintenance_work_mem, PVShared::maintenance_work_mem_worker, VacDeadItems::max_items, MemSet, Min, mul_size(), ParallelVacuumState::nindexes, ParallelVacuumState::nindexes_parallel_bulkdel, ParallelVacuumState::nindexes_parallel_cleanup, ParallelVacuumState::nindexes_parallel_condcleanup, VacDeadItems::num_items, ParallelContext::nworkers, palloc0(), parallel_vacuum_compute_workers(), PARALLEL_VACUUM_KEY_BUFFER_USAGE, PARALLEL_VACUUM_KEY_DEAD_ITEMS, 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(), 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(), ParallelContext::toc, vac_max_items_to_alloc_size(), 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 957 of file vacuumparallel.c.
References PVShared::active_nworkers, ErrorContextCallback::arg, Assert(), BAS_VACUUM, ParallelVacuumState::bstrategy, ErrorContextCallback::callback, PVShared::cost_balance, ParallelVacuumState::dead_items, 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_DEAD_ITEMS, 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(), ErrorContextCallback::previous, PROC_IN_VACUUM, pstrdup(), 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(), vac_close_indexes(), vac_open_indexes(), VacuumActiveNWorkers, VacuumCostBalance, VacuumCostBalanceLocal, VacuumPageDirty, VacuumPageHit, VacuumPageMiss, VacuumSharedCostBalance, and VacuumUpdateCosts().
bool std_typanalyze | ( | VacAttrStats * | stats | ) |
Definition at line 1876 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, | ||
VacDeadItems * | dead_items | ||
) |
Definition at line 2476 of file vacuum.c.
References ereport, errmsg(), IndexVacuumInfo::index, index_bulk_delete(), IndexVacuumInfo::message_level, VacDeadItems::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 2497 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 2301 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 1305 of file vacuum.c.
References RelationData::rd_rel.
Referenced by lazy_scan_heap(), and statapprox_heap().
Size vac_max_items_to_alloc_size | ( | int | max_items | ) |
Definition at line 2522 of file vacuum.c.
References Assert(), MaxAllocSize, and MAXDEADITEMS.
Referenced by dead_items_alloc(), and parallel_vacuum_init().
Definition at line 2258 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 1568 of file vacuum.c.
References AccessShareLock, Assert(), BTEqualStrategyNumber, elog(), ERROR, ExclusiveLock, ForceTransactionIdLimitUpdate(), GetOldestMultiXactId(), GetOldestNonRemovableTransactionId(), GETSTRUCT, heap_copytuple(), heap_freetuple(), heap_inplace_update(), HeapTupleIsValid, InvalidOid, sort-test::key, LockDatabaseFrozenIds(), MultiXactIdIsValid, MultiXactIdPrecedes(), MyDatabaseId, ObjectIdGetDatum(), ReadNextMultiXactId(), ReadNextTransactionId(), RowExclusiveLock, ScanKeyInit(), systable_beginscan(), systable_endscan(), systable_getnext(), 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 1401 of file vacuum.c.
References elog(), ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg_internal(), ERROR, GETSTRUCT, heap_inplace_update(), HeapTupleIsValid, MultiXactIdIsValid, MultiXactIdPrecedes(), ObjectIdGetDatum(), RelationData::rd_rules, ReadNextMultiXactId(), ReadNextTransactionId(), RelationGetRelationName, RelationGetRelid, RELOID, RowExclusiveLock, SearchSysCacheCopy1, 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(), analyze_rel(), Assert(), CommandCounterIncrement(), CommitTransactionCommand(), cur, ereport, errcode(), errmsg(), ERROR, expand_vacuum_rel(), get_all_vacuum_rels(), GetTransactionSnapshot(), IsAutoVacuumWorkerProcess(), 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, VacuumPageDirty, VacuumPageHit, VacuumPageMiss, 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 2322 of file vacuum.c.
References AutoVacuumUpdateCostLimit(), CHECK_FOR_INTERRUPTS, compute_parallel_delay(), ConfigReloadPending, exit(), InterruptPending, IsAutoVacuumWorkerProcess(), 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_scan_skip(), lazy_vacuum_heap_rel(), spgprocesspending(), and spgvacuumpage().
bool vacuum_get_cutoffs | ( | Relation | rel, |
const VacuumParams * | params, | ||
struct VacuumCutoffs * | cutoffs | ||
) |
Definition at line 1075 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_relation_owner | ( | Oid | relid, |
Form_pg_class | reltuple, | ||
bits32 | options | ||
) |
Definition at line 707 of file vacuum.c.
References Assert(), ereport, errmsg(), GetUserId(), MyDatabaseId, NameStr, object_ownercheck(), 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 761 of file vacuum.c.
References Assert(), ConditionalLockRelationOid(), ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errmsg(), IsAutoVacuumWorkerProcess(), 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 1243 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 1786 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 83 of file analyze.c.
Referenced by multirange_typanalyze(), range_typanalyze(), statext_compute_stattarget(), std_typanalyze(), and ts_typanalyze().
|
extern |
Definition at line 82 of file vacuum.c.
Referenced by compute_parallel_delay(), default_reloptions(), vacuum_delay_point(), and VacuumUpdateCosts().
|
extern |
Definition at line 83 of file vacuum.c.
Referenced by AutoVacuumUpdateCostLimit(), compute_parallel_delay(), default_reloptions(), vacuum_delay_point(), and VacuumUpdateCosts().
|
extern |
Definition at line 73 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 74 of file vacuum.c.
Referenced by vacuum_xid_failsafe_check().
|
extern |
Definition at line 71 of file vacuum.c.
Referenced by do_autovacuum(), and vacuum_get_cutoffs().
|
extern |
Definition at line 72 of file vacuum.c.
Referenced by do_autovacuum(), and vacuum_get_cutoffs().
|
extern |
Definition at line 105 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 106 of file vacuum.c.
Referenced by compute_parallel_delay(), parallel_vacuum_main(), parallel_vacuum_process_all_indexes(), and vacuum().
|
extern |
Definition at line 98 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 104 of file vacuum.c.
Referenced by compute_parallel_delay(), parallel_vacuum_main(), parallel_vacuum_process_all_indexes(), vacuum(), and vacuum_delay_point().