PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <signal.h>
#include <sys/time.h>
#include <unistd.h>
#include "access/heapam.h"
#include "access/htup_details.h"
#include "access/multixact.h"
#include "access/reloptions.h"
#include "access/tableam.h"
#include "access/transam.h"
#include "access/xact.h"
#include "catalog/dependency.h"
#include "catalog/namespace.h"
#include "catalog/pg_database.h"
#include "commands/dbcommands.h"
#include "commands/vacuum.h"
#include "lib/ilist.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "pgstat.h"
#include "postmaster/autovacuum.h"
#include "postmaster/fork_process.h"
#include "postmaster/interrupt.h"
#include "postmaster/postmaster.h"
#include "storage/bufmgr.h"
#include "storage/ipc.h"
#include "storage/latch.h"
#include "storage/lmgr.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procsignal.h"
#include "storage/sinvaladt.h"
#include "storage/smgr.h"
#include "tcop/tcopprot.h"
#include "utils/fmgroids.h"
#include "utils/fmgrprotos.h"
#include "utils/guc_hooks.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
#include "utils/timeout.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | avl_dbase |
struct | avw_dbase |
struct | av_relation |
struct | autovac_table |
struct | WorkerInfoData |
struct | AutoVacuumWorkItem |
struct | AutoVacuumShmemStruct |
Macros | |
#define | MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */ |
#define | MAX_AUTOVAC_SLEEPTIME 300 /* seconds */ |
#define | NUM_WORKITEMS 256 |
#define | MAX_AUTOVAC_ACTIV_LEN (NAMEDATALEN * 2 + 56) |
Typedefs | |
typedef struct avl_dbase | avl_dbase |
typedef struct avw_dbase | avw_dbase |
typedef struct av_relation | av_relation |
typedef struct autovac_table | autovac_table |
typedef struct WorkerInfoData | WorkerInfoData |
typedef struct WorkerInfoData * | WorkerInfo |
typedef struct AutoVacuumWorkItem | AutoVacuumWorkItem |
Enumerations | |
enum | AutoVacuumSignal { AutoVacForkFailed , AutoVacRebalance , AutoVacNumSignals } |
#define MAX_AUTOVAC_ACTIV_LEN (NAMEDATALEN * 2 + 56) |
#define MAX_AUTOVAC_SLEEPTIME 300 /* seconds */ |
Definition at line 136 of file autovacuum.c.
#define MIN_AUTOVAC_SLEEPTIME 100.0 /* milliseconds */ |
Definition at line 135 of file autovacuum.c.
#define NUM_WORKITEMS 256 |
Definition at line 263 of file autovacuum.c.
typedef struct autovac_table autovac_table |
typedef struct AutoVacuumWorkItem AutoVacuumWorkItem |
typedef struct av_relation av_relation |
typedef struct WorkerInfoData* WorkerInfo |
Definition at line 233 of file autovacuum.c.
typedef struct WorkerInfoData WorkerInfoData |
enum AutoVacuumSignal |
Enumerator | |
---|---|
AutoVacForkFailed | |
AutoVacRebalance | |
AutoVacNumSignals |
Definition at line 240 of file autovacuum.c.
|
static |
Definition at line 1797 of file autovacuum.c.
References autovacuum_vac_cost_delay, autovacuum_vac_cost_limit, AutoVacuumShmem, AutoVacuumShmemStruct::av_runningWorkers, dlist_iter::cur, DEBUG2, dlist_container, dlist_foreach, elog(), Max, Min, PGPROC::pid, VacuumCostDelay, VacuumCostLimit, WorkerInfoData::wi_cost_delay, WorkerInfoData::wi_cost_limit, WorkerInfoData::wi_cost_limit_base, WorkerInfoData::wi_dboid, WorkerInfoData::wi_dobalance, WorkerInfoData::wi_proc, and WorkerInfoData::wi_tableoid.
Referenced by AutoVacLauncherMain(), do_autovacuum(), and HandleAutoVacLauncherInterrupts().
void autovac_init | ( | void | ) |
Definition at line 3301 of file autovacuum.c.
References autovacuum_start_daemon, ereport, errhint(), errmsg(), pgstat_track_counts, and WARNING.
Referenced by PostmasterMain().
|
static |
Definition at line 3172 of file autovacuum.c.
References autovac_table::at_nspname, autovac_table::at_params, autovac_table::at_relname, VacuumParams::is_wraparound, len, MAX_AUTOVAC_ACTIV_LEN, VacuumParams::options, pgstat_report_activity(), SetCurrentStatementStartTimestamp(), snprintf, STATE_RUNNING, VACOPT_ANALYZE, and VACOPT_VACUUM.
Referenced by autovacuum_do_vac_analyze().
|
static |
Definition at line 3207 of file autovacuum.c.
References AutoVacuumWorkItem::avw_blockNumber, AVW_BRINSummarizeRange, AutoVacuumWorkItem::avw_type, BlockNumberIsValid(), len, MAX_AUTOVAC_ACTIV_LEN, pgstat_report_activity(), relname, SetCurrentStatementStartTimestamp(), snprintf, and STATE_RUNNING.
Referenced by perform_work_item().
NON_EXEC_STATIC void AutoVacLauncherMain | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 431 of file autovacuum.c.
References AbortBufferIO(), AbortCurrentTransaction(), avl_dbase::adl_next_worker, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, am_autovacuum_launcher, AtEOXact_Buffers(), AtEOXact_Files(), AtEOXact_HashTables(), AtEOXact_SMgr(), autovac_balance_cost(), AutoVacForkFailed, AutoVacLauncherShutdown(), AutovacMemCxt, AutoVacRebalance, autovacuum_naptime, AutoVacuumingActive(), AutoVacuumShmem, AuxProcessResourceOwner, AutoVacuumShmemStruct::av_freeWorkers, AutoVacuumShmemStruct::av_launcherpid, AutoVacuumShmemStruct::av_signal, AutoVacuumShmemStruct::av_startingWorker, avl_sigusr2_handler(), B_AUTOVAC_LAUNCHER, BaseInit(), current_time(), DatabaseList, DatabaseListCxt, DEBUG1, disable_all_timeouts(), dlist_init(), dlist_is_empty(), dlist_push_head(), dlist_tail_element, do_start_worker(), EmitErrorReport(), ereport, errmsg(), errmsg_internal(), error_context_stack, FloatExceptionHandler(), FlushErrorState(), GetCurrentTimestamp(), got_SIGUSR2, HandleAutoVacLauncherInterrupts(), HOLD_INTERRUPTS, init_ps_display(), InitializeTimeouts(), InitPostgres(), InitProcess(), InitProcessing, InvalidOid, launch_worker(), launcher_determine_sleep(), LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), LWLockReleaseAll(), MemoryContextResetAndDeleteChildren, MemoryContextSwitchTo(), Min, MyBackendType, MyLatch, MyProcPid, NormalProcessing, PG_exception_stack, pg_usleep(), PGC_S_OVERRIDE, PGC_SUSET, pgstat_report_wait_end(), PMSIGNAL_START_AUTOVAC_WORKER, PostAuthDelay, pqsignal(), proc_exit(), procsignal_sigusr1_handler(), QueryCancelPending, rebuild_database_list(), ReleaseAuxProcessResources(), ResetLatch(), RESUME_INTERRUPTS, SendPostmasterSignal(), SetConfigOption(), SetProcessingMode, ShutdownRequestPending, SIG_DFL, SIG_IGN, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), SIGPIPE, SIGUSR1, SIGUSR2, StatementCancelHandler(), TimestampDifferenceExceeds(), TopMemoryContext, UnBlockSig, UnlockBuffers(), WAIT_EVENT_AUTOVACUUM_MAIN, WaitLatch(), WARNING, WorkerInfoData::wi_dboid, WorkerInfoData::wi_launchtime, WorkerInfoData::wi_links, WorkerInfoData::wi_proc, WorkerInfoData::wi_sharedrel, WorkerInfoData::wi_tableoid, WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, and WL_TIMEOUT.
|
static |
Definition at line 315 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), and HandleAutoVacLauncherInterrupts().
|
static |
Definition at line 3143 of file autovacuum.c.
References autovac_table::at_nspname, autovac_table::at_params, autovac_table::at_relid, autovac_table::at_relname, autovac_report_activity(), list_make1, makeRangeVar(), makeVacuumRelation(), NIL, and vacuum().
Referenced by do_autovacuum().
bool AutoVacuumingActive | ( | void | ) |
Definition at line 3247 of file autovacuum.c.
References autovacuum_start_daemon, and pgstat_track_counts.
Referenced by AutoVacLauncherMain(), HandleAutoVacLauncherInterrupts(), process_pm_child_exit(), relation_needs_vacanalyze(), and ServerLoop().
bool AutoVacuumRequestWork | ( | AutoVacuumWorkItemType | type, |
Oid | relationId, | ||
BlockNumber | blkno | ||
) |
Definition at line 3259 of file autovacuum.c.
References AutoVacuumShmem, AutoVacuumShmemStruct::av_workItems, AutoVacuumWorkItem::avw_active, AutoVacuumWorkItem::avw_blockNumber, AutoVacuumWorkItem::avw_database, AutoVacuumWorkItem::avw_relation, AutoVacuumWorkItem::avw_type, AutoVacuumWorkItem::avw_used, i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyDatabaseId, NUM_WORKITEMS, and generate_unaccent_rules::type.
Referenced by brininsert().
void AutoVacuumShmemInit | ( | void | ) |
Definition at line 3351 of file autovacuum.c.
References Assert(), autovacuum_max_workers, AutoVacuumShmem, AutoVacuumShmemSize(), AutoVacuumShmemStruct::av_freeWorkers, AutoVacuumShmemStruct::av_launcherpid, AutoVacuumShmemStruct::av_runningWorkers, AutoVacuumShmemStruct::av_startingWorker, AutoVacuumShmemStruct::av_workItems, dlist_init(), dlist_push_head(), i, IsUnderPostmaster, MAXALIGN, NUM_WORKITEMS, ShmemInitStruct(), and WorkerInfoData::wi_links.
Referenced by CreateSharedMemoryAndSemaphores().
Size AutoVacuumShmemSize | ( | void | ) |
Definition at line 3332 of file autovacuum.c.
References add_size(), autovacuum_max_workers, MAXALIGN, and mul_size().
Referenced by AutoVacuumShmemInit(), and CalculateShmemSize().
void AutoVacuumUpdateDelay | ( | void | ) |
Definition at line 1781 of file autovacuum.c.
References MyWorkerInfo, VacuumCostDelay, VacuumCostLimit, WorkerInfoData::wi_cost_delay, and WorkerInfoData::wi_cost_limit.
Referenced by do_autovacuum(), and vacuum_delay_point().
void AutoVacWorkerFailed | ( | void | ) |
Definition at line 1411 of file autovacuum.c.
References AutoVacForkFailed, AutoVacuumShmem, and AutoVacuumShmemStruct::av_signal.
Referenced by StartAutovacuumWorker().
NON_EXEC_STATIC void AutoVacWorkerMain | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 1509 of file autovacuum.c.
References am_autovacuum_worker, AutoVacuumShmem, AutoVacuumShmemStruct::av_launcherpid, AutoVacuumShmemStruct::av_runningWorkers, AutoVacuumShmemStruct::av_startingWorker, B_AUTOVAC_WORKER, BaseInit(), dbname, DEBUG1, die, dlist_push_head(), do_autovacuum(), elog(), EmitErrorReport(), ereport, errmsg_internal(), error_context_stack, FloatExceptionHandler(), FreeWorkerInfo(), HOLD_INTERRUPTS, init_ps_display(), InitializeTimeouts(), InitPostgres(), InitProcess(), InitProcessing, InvalidOid, kill, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyBackendType, MyProc, MyWorkerInfo, NAMEDATALEN, NormalProcessing, OidIsValid, on_shmem_exit(), PG_exception_stack, pg_usleep(), PGC_S_OVERRIDE, PGC_SUSET, pgstat_report_autovac(), PostAuthDelay, pqsignal(), proc_exit(), procsignal_sigusr1_handler(), ReadNextMultiXactId(), ReadNextTransactionId(), recentMulti, recentXid, set_ps_display(), SetConfigOption(), SetProcessingMode, SIG_DFL, SIG_IGN, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SIGPIPE, SIGUSR1, SIGUSR2, StatementCancelHandler(), synchronous_commit, SYNCHRONOUS_COMMIT_LOCAL_FLUSH, UnBlockSig, WARNING, WorkerInfoData::wi_dboid, WorkerInfoData::wi_links, and WorkerInfoData::wi_proc.
Referenced by StartAutoVacWorker().
|
static |
Definition at line 1418 of file autovacuum.c.
References got_SIGUSR2, MyLatch, and SetLatch().
Referenced by AutoVacLauncherMain().
|
static |
|
static |
Definition at line 1958 of file autovacuum.c.
References AbortOutOfAnyTransaction(), AccessExclusiveLock, AccessShareLock, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, av_relation::ar_hasrelopts, av_relation::ar_relid, av_relation::ar_reloptions, autovac_table::at_datname, autovac_table::at_dobalance, autovac_table::at_nspname, autovac_table::at_params, autovac_table::at_relid, autovac_table::at_relname, autovac_table::at_vacuum_cost_delay, autovac_table::at_vacuum_cost_limit, autovac_balance_cost(), AutovacMemCxt, autovacuum_do_vac_analyze(), AutoVacuumShmem, AutoVacuumUpdateDelay(), AutoVacuumShmemStruct::av_runningWorkers, AutoVacuumShmemStruct::av_workItems, AutoVacuumWorkItem::avw_active, AutoVacuumWorkItem::avw_database, AutoVacuumWorkItem::avw_used, BAS_VACUUM, BTEqualStrategyNumber, CharGetDatum(), CHECK_FOR_INTERRUPTS, checkTempNamespaceStatus(), CommitTransactionCommand(), ConditionalLockRelationOid(), ConfigReloadPending, CreateTupleDescCopy(), dlist_iter::cur, DATABASEOID, default_freeze_min_age, default_freeze_table_age, default_multixact_freeze_min_age, default_multixact_freeze_table_age, dlist_container, dlist_foreach, DROP_CASCADE, elog(), EmitErrorReport(), HASHCTL::entrysize, ereport, errcontext, errmsg(), ERROR, extract_autovac_opts(), FlushErrorState(), ForwardScanDirection, get_database_name(), get_namespace_name(), get_rel_name(), get_rel_namespace(), GetAccessStrategy(), GETSTRUCT, HASH_BLOBS, hash_create(), HASH_ELEM, HASH_ENTER, HASH_FIND, hash_search(), heap_getnext(), HeapTupleIsValid, HOLD_INTERRUPTS, i, InvalidOid, sort-test::key, HASHCTL::keysize, lappend_oid(), lfirst_oid, LOG, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemoryContextResetAndDeleteChildren, MemoryContextSwitchTo(), MultiXactMemberFreezeThreshold(), MyDatabaseId, MyWorkerInfo, NameStr, NIL, NUM_WORKITEMS, ObjectIdGetDatum(), OidIsValid, VacuumParams::options, PERFORM_DELETION_INTERNAL, PERFORM_DELETION_QUIETLY, PERFORM_DELETION_SKIP_EXTENSIONS, perform_work_item(), performDeletion(), pfree(), PG_CATCH, PG_END_TRY, PG_TRY, PGC_SIGHUP, pgstat_fetch_stat_tabentry_ext(), PortalContext, ProcessConfigFile(), QueryCancelPending, relation_needs_vacanalyze(), RelationGetDescr, ReleaseSysCache(), RELOID, RESUME_INTERRUPTS, ScanKeyInit(), SearchSysCache1(), SearchSysCacheCopy1, StartTransactionCommand(), table_beginscan_catalog(), table_close(), table_endscan(), table_open(), table_recheck_autovac(), TEMP_NAMESPACE_IDLE, TopMemoryContext, UnlockRelationOid(), vac_update_datfrozenxid(), VACOPT_VACUUM, vacuum_freeze_min_age, vacuum_freeze_table_age, vacuum_multixact_freeze_min_age, vacuum_multixact_freeze_table_age, VacuumCostDelay, VacuumCostLimit, WorkerInfoData::wi_cost_delay, WorkerInfoData::wi_cost_limit, WorkerInfoData::wi_cost_limit_base, WorkerInfoData::wi_dboid, WorkerInfoData::wi_dobalance, WorkerInfoData::wi_sharedrel, and WorkerInfoData::wi_tableoid.
Referenced by AutoVacWorkerMain().
|
static |
Definition at line 1147 of file autovacuum.c.
References avl_dbase::adl_datid, avl_dbase::adl_next_worker, avw_dbase::adw_datid, avw_dbase::adw_entry, avw_dbase::adw_frozenxid, avw_dbase::adw_minmulti, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, autovacuum_freeze_max_age, autovacuum_naptime, AutoVacuumShmem, AutoVacuumShmemStruct::av_freeWorkers, AutoVacuumShmemStruct::av_startingWorker, dlist_iter::cur, current_time(), CurrentMemoryContext, DatabaseList, dblist, dlist_container, dlist_is_empty(), dlist_pop_head_node(), dlist_reverse_foreach, FirstMultiXactId, FirstNormalTransactionId, get_database_list(), GetCurrentTimestamp(), InvalidOid, PgStat_StatDBEntry::last_autovac_time, lfirst, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemoryContextDelete(), MemoryContextSwitchTo(), MultiXactIdPrecedes(), MultiXactMemberFreezeThreshold(), pgstat_fetch_stat_dbentry(), PMSIGNAL_START_AUTOVAC_WORKER, ReadNextMultiXactId(), ReadNextTransactionId(), rebuild_database_list(), recentMulti, recentXid, SendPostmasterSignal(), TimestampDifferenceExceeds(), TransactionIdPrecedes(), WorkerInfoData::wi_dboid, WorkerInfoData::wi_launchtime, and WorkerInfoData::wi_proc.
Referenced by AutoVacLauncherMain(), and launch_worker().
|
static |
Definition at line 2729 of file autovacuum.c.
References Assert(), av, extractRelOptions(), GETSTRUCT, palloc(), and pfree().
Referenced by do_autovacuum(), and table_recheck_autovac().
|
static |
Definition at line 1732 of file autovacuum.c.
References AutoVacRebalance, AutovacuumLauncherPid, AutoVacuumShmem, AutoVacuumShmemStruct::av_freeWorkers, AutoVacuumShmemStruct::av_launcherpid, AutoVacuumShmemStruct::av_signal, dlist_delete(), dlist_push_head(), InvalidOid, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyWorkerInfo, WorkerInfoData::wi_cost_delay, WorkerInfoData::wi_cost_limit, WorkerInfoData::wi_cost_limit_base, WorkerInfoData::wi_dboid, WorkerInfoData::wi_dobalance, WorkerInfoData::wi_launchtime, WorkerInfoData::wi_links, WorkerInfoData::wi_proc, WorkerInfoData::wi_sharedrel, and WorkerInfoData::wi_tableoid.
Referenced by AutoVacWorkerMain().
|
static |
Definition at line 1885 of file autovacuum.c.
References AccessShareLock, avw_dbase::adw_datid, avw_dbase::adw_entry, avw_dbase::adw_frozenxid, avw_dbase::adw_minmulti, avw_dbase::adw_name, CommitTransactionCommand(), CurrentMemoryContext, dblist, ForwardScanDirection, GETSTRUCT, GetTransactionSnapshot(), heap_getnext(), HeapTupleIsValid, lappend(), MemoryContextSwitchTo(), NameStr, NIL, palloc(), pstrdup(), StartTransactionCommand(), table_beginscan_catalog(), table_close(), table_endscan(), and table_open().
Referenced by do_start_worker(), and rebuild_database_list().
|
static |
Definition at line 807 of file autovacuum.c.
References autovac_balance_cost(), AutoVacLauncherShutdown(), AutoVacuumingActive(), ConfigReloadPending, InvalidOid, LogMemoryContextPending, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PGC_SIGHUP, ProcessCatchupInterrupt(), ProcessConfigFile(), ProcessLogMemoryContextInterrupt(), ProcessProcSignalBarrier(), ProcSignalBarrierPending, rebuild_database_list(), and ShutdownRequestPending.
Referenced by AutoVacLauncherMain().
bool IsAutoVacuumLauncherProcess | ( | void | ) |
Definition at line 3315 of file autovacuum.c.
References am_autovacuum_launcher.
Referenced by InitPostgres(), InitProcess(), and ProcKill().
bool IsAutoVacuumWorkerProcess | ( | void | ) |
Definition at line 3321 of file autovacuum.c.
References am_autovacuum_worker.
Referenced by BuildRelationExtStatistics(), CheckMyDatabase(), dead_items_max_items(), do_analyze_rel(), expand_vacuum_rel(), ginbulkdelete(), ginInsertCleanup(), ginvacuumcleanup(), heap_vacuum_rel(), InitializeSessionUserIdStandalone(), InitPostgres(), InitProcess(), pgstat_report_analyze(), pgstat_report_vacuum(), proc_exit(), ProcessInterrupts(), vacuum(), and vacuum_open_relation().
|
static |
Definition at line 1359 of file autovacuum.c.
References avl_dbase::adl_datid, avl_dbase::adl_next_worker, autovacuum_naptime, dlist_iter::cur, DatabaseList, dlist_container, dlist_foreach, dlist_move_head(), do_start_worker(), now(), OidIsValid, rebuild_database_list(), and TimestampTzPlusMilliseconds.
Referenced by AutoVacLauncherMain().
|
static |
Definition at line 864 of file autovacuum.c.
References avl_dbase::adl_next_worker, autovacuum_naptime, current_time(), DatabaseList, dlist_is_empty(), dlist_tail_element, GetCurrentTimestamp(), InvalidOid, MAX_AUTOVAC_SLEEPTIME, MIN_AUTOVAC_SLEEPTIME, rebuild_database_list(), and TimestampDifference().
Referenced by AutoVacLauncherMain().
|
static |
Definition at line 2618 of file autovacuum.c.
References AbortOutOfAnyTransaction(), Assert(), autovac_report_workitem(), AutovacMemCxt, AutoVacuumWorkItem::avw_blockNumber, AVW_BRINSummarizeRange, AutoVacuumWorkItem::avw_relation, AutoVacuumWorkItem::avw_type, brin_summarize_range(), CurrentMemoryContext, DirectFunctionCall2, elog(), EmitErrorReport(), errcontext, FlushErrorState(), get_database_name(), get_namespace_name(), get_rel_name(), get_rel_namespace(), HOLD_INTERRUPTS, Int64GetDatum(), MemoryContextResetAndDeleteChildren, MemoryContextSwitchTo(), MyDatabaseId, ObjectIdGetDatum(), pfree(), PG_CATCH, PG_END_TRY, PG_TRY, PortalContext, QueryCancelPending, RESUME_INTERRUPTS, StartTransactionCommand(), and WARNING.
Referenced by do_autovacuum().
|
static |
Definition at line 948 of file autovacuum.c.
References avl_dbase::adl_datid, avl_dbase::adl_next_worker, avl_dbase::adl_node, avl_dbase::adl_score, avw_dbase::adw_datid, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AutovacMemCxt, autovacuum_naptime, dlist_iter::cur, current_time(), DatabaseList, DatabaseListCxt, db_comparator(), dblist, dlist_container, dlist_foreach, dlist_init(), dlist_push_head(), HASHCTL::entrysize, get_database_list(), GetCurrentTimestamp(), HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), hash_seq_init(), hash_seq_search(), HASHCTL::hcxt, i, HASHCTL::keysize, lfirst, MemoryContextDelete(), MemoryContextSwitchTo(), MIN_AUTOVAC_SLEEPTIME, OidIsValid, palloc(), pgstat_fetch_stat_dbentry(), qsort, and TimestampTzPlusMilliseconds.
Referenced by AutoVacLauncherMain(), do_start_worker(), HandleAutoVacLauncherInterrupts(), launch_worker(), and launcher_determine_sleep().
|
static |
Definition at line 2912 of file autovacuum.c.
References pgstat_fetch_stat_tabentry_ext(), and relation_needs_vacanalyze().
Referenced by table_recheck_autovac().
|
static |
Definition at line 2973 of file autovacuum.c.
References AutoVacOpts::analyze_scale_factor, AutoVacOpts::analyze_threshold, Assert(), autovacuum_anl_scale, autovacuum_anl_thresh, autovacuum_freeze_max_age, autovacuum_vac_ins_scale, autovacuum_vac_ins_thresh, autovacuum_vac_scale, autovacuum_vac_thresh, AutoVacuumingActive(), PgStat_StatTabEntry::dead_tuples, DEBUG3, elog(), AutoVacOpts::enabled, FirstMultiXactId, FirstNormalTransactionId, AutoVacOpts::freeze_max_age, PgStat_StatTabEntry::ins_since_vacuum, Min, PgStat_StatTabEntry::mod_since_analyze, AutoVacOpts::multixact_freeze_max_age, MultiXactIdIsValid, MultiXactIdPrecedes(), NameStr, OidIsValid, PointerIsValid, recentMulti, recentXid, TransactionIdIsNormal, TransactionIdPrecedes(), AutoVacOpts::vacuum_ins_scale_factor, AutoVacOpts::vacuum_ins_threshold, AutoVacOpts::vacuum_scale_factor, and AutoVacOpts::vacuum_threshold.
Referenced by do_autovacuum(), and recheck_relation_needs_vacanalyze().
int StartAutoVacWorker | ( | void | ) |
Definition at line 1471 of file autovacuum.c.
References AutoVacWorkerMain(), ClosePostmasterPorts(), ereport, errmsg(), fork_process(), InitPostmasterChild(), and LOG.
Referenced by StartAutovacuumWorker().
|
static |
Definition at line 2759 of file autovacuum.c.
References av_relation::ar_hasrelopts, av_relation::ar_reloptions, autovac_table::at_datname, autovac_table::at_dobalance, autovac_table::at_nspname, autovac_table::at_params, autovac_table::at_relid, autovac_table::at_relname, autovac_table::at_sharedrel, autovac_table::at_vacuum_cost_delay, autovac_table::at_vacuum_cost_limit, autovacuum_vac_cost_delay, autovacuum_vac_cost_limit, default_freeze_min_age, default_freeze_table_age, default_multixact_freeze_min_age, default_multixact_freeze_table_age, extract_autovac_opts(), VacuumParams::freeze_min_age, AutoVacOpts::freeze_min_age, VacuumParams::freeze_table_age, AutoVacOpts::freeze_table_age, GETSTRUCT, HASH_FIND, hash_search(), heap_freetuple(), HeapTupleIsValid, VacuumParams::index_cleanup, VacuumParams::is_wraparound, Log_autovacuum_min_duration, VacuumParams::log_min_duration, AutoVacOpts::log_min_duration, VacuumParams::multixact_freeze_min_age, AutoVacOpts::multixact_freeze_min_age, VacuumParams::multixact_freeze_table_age, AutoVacOpts::multixact_freeze_table_age, VacuumParams::nworkers, ObjectIdGetDatum(), VacuumParams::options, palloc(), recheck_relation_needs_vacanalyze(), RELOID, SearchSysCacheCopy1, VacuumParams::truncate, VACOPT_ANALYZE, VACOPT_PROCESS_MAIN, VACOPT_SKIP_DATABASE_STATS, VACOPT_SKIP_LOCKED, VACOPT_VACUUM, VACOPTVALUE_UNSPECIFIED, AutoVacOpts::vacuum_cost_delay, AutoVacOpts::vacuum_cost_limit, VacuumCostDelay, and VacuumCostLimit.
Referenced by do_autovacuum().
Definition at line 139 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), and IsAutoVacuumLauncherProcess().
Definition at line 140 of file autovacuum.c.
Referenced by AutoVacWorkerMain(), and IsAutoVacuumWorkerProcess().
|
static |
Definition at line 156 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), do_autovacuum(), perform_work_item(), and rebuild_database_list().
double autovacuum_anl_scale |
Definition at line 125 of file autovacuum.c.
Referenced by relation_needs_vacanalyze().
int autovacuum_anl_thresh |
Definition at line 124 of file autovacuum.c.
Referenced by relation_needs_vacanalyze().
int autovacuum_freeze_max_age |
Definition at line 126 of file autovacuum.c.
Referenced by do_start_worker(), relation_needs_vacanalyze(), SetTransactionIdLimit(), vacuum_get_cutoffs(), and vacuum_xid_failsafe_check().
int autovacuum_max_workers |
Definition at line 117 of file autovacuum.c.
Referenced by AutoVacuumShmemInit(), AutoVacuumShmemSize(), check_max_connections(), check_max_wal_senders(), check_max_worker_processes(), InitializeMaxBackends(), InitProcGlobal(), and MaxLivePostmasterChildren().
int autovacuum_multixact_freeze_max_age |
Definition at line 127 of file autovacuum.c.
Referenced by MultiXactMemberFreezeThreshold(), SetMultiXactIdLimit(), and vacuum_xid_failsafe_check().
int autovacuum_naptime |
Definition at line 119 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), do_start_worker(), launch_worker(), launcher_determine_sleep(), and rebuild_database_list().
Definition at line 116 of file autovacuum.c.
Referenced by autovac_init(), and AutoVacuumingActive().
double autovacuum_vac_cost_delay |
Definition at line 129 of file autovacuum.c.
Referenced by autovac_balance_cost(), and table_recheck_autovac().
int autovacuum_vac_cost_limit |
Definition at line 130 of file autovacuum.c.
Referenced by autovac_balance_cost(), and table_recheck_autovac().
double autovacuum_vac_ins_scale |
Definition at line 123 of file autovacuum.c.
Referenced by relation_needs_vacanalyze().
int autovacuum_vac_ins_thresh |
Definition at line 122 of file autovacuum.c.
Referenced by relation_needs_vacanalyze().
double autovacuum_vac_scale |
Definition at line 121 of file autovacuum.c.
Referenced by relation_needs_vacanalyze().
int autovacuum_vac_thresh |
Definition at line 120 of file autovacuum.c.
Referenced by relation_needs_vacanalyze().
int autovacuum_work_mem = -1 |
Definition at line 118 of file autovacuum.c.
Referenced by dead_items_max_items(), and ginInsertCleanup().
int AutovacuumLauncherPid = 0 |
Definition at line 304 of file autovacuum.c.
Referenced by FreeWorkerInfo(), and ProcKill().
|
static |
Definition at line 291 of file autovacuum.c.
Referenced by autovac_balance_cost(), AutoVacLauncherMain(), AutoVacuumRequestWork(), AutoVacuumShmemInit(), AutoVacWorkerFailed(), AutoVacWorkerMain(), do_autovacuum(), do_start_worker(), and FreeWorkerInfo().
|
static |
Definition at line 297 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), do_start_worker(), launch_worker(), launcher_determine_sleep(), and rebuild_database_list().
|
static |
Definition at line 298 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), and rebuild_database_list().
|
static |
Definition at line 150 of file autovacuum.c.
Referenced by do_autovacuum(), and table_recheck_autovac().
|
static |
Definition at line 151 of file autovacuum.c.
Referenced by do_autovacuum(), and table_recheck_autovac().
|
static |
Definition at line 152 of file autovacuum.c.
Referenced by do_autovacuum(), and table_recheck_autovac().
|
static |
Definition at line 153 of file autovacuum.c.
Referenced by do_autovacuum(), and table_recheck_autovac().
|
static |
Definition at line 143 of file autovacuum.c.
Referenced by AutoVacLauncherMain(), and avl_sigusr2_handler().
int Log_autovacuum_min_duration = 600000 |
Definition at line 132 of file autovacuum.c.
Referenced by table_recheck_autovac().
|
static |
Definition at line 301 of file autovacuum.c.
Referenced by AutoVacuumUpdateDelay(), AutoVacWorkerMain(), do_autovacuum(), and FreeWorkerInfo().
|
static |
Definition at line 147 of file autovacuum.c.
Referenced by AutoVacWorkerMain(), do_start_worker(), and relation_needs_vacanalyze().
|
static |
Definition at line 146 of file autovacuum.c.
Referenced by AutoVacWorkerMain(), do_start_worker(), and relation_needs_vacanalyze().