Quick onboard
Deployment
Data Modeling
Connecting
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool guide
Data type
Storage Engine
Executor
Stream
DR (Disaster Recovery)
Configuration
Index
Extension
SQL Reference
This document describes the configuration parameters in the Automatic Vacuuming category.
Caution!
To ensure system stability and security, manually modifying these parameters should be done with extreme care.
Enables or disables the autovacuum launcher background process.
track_counts must also be enabled. If track_counts is set to off, autovacuum will not take effect independently.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; system; reload |
Specifies a fraction of the table size to be added to autovacuum_analyze_threshold when determining whether to trigger an ANALYZE.
0.1 (10% of table size). This value can be overridden for individual tables by modifying table storage parameters.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| floating point | 0.1 | 0.0 ~ 100.0 | segments; session; reload |
Sets the minimum number of inserted, updated, or deleted tuples in a table that triggers an ANALYZE.
| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | 50 | 0 ~ INT_MAX | segments; system; reload |
Determines the maximum age (in transactions) that a table’s relfrozenxid can reach before a VACUUM is forced to prevent transaction ID wraparound.
pg_xact subdirectory, which is why the default is set relatively low at 200 million transactions.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | 200000000 | 100000 ~ 200000000 | segments; system; restart |
Sets the maximum number of autovacuum worker processes that can run simultaneously (excluding the autovacuum launcher process).
| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | 3 | 1 ~ 262143 | segments; system; restart |
Determines the maximum age (in multitransactions) that a table’s relminmxid can reach before a VACUUM is forced to prevent multitransaction ID wraparound.
pg_multixact/members and pg_multixact/offsets subdirectories, which is why the default is set relatively low at 400 million multitransactions.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | 400000000 | 10000 ~ 2000000000 | segments; system; restart |
When the autovacuum parameter is enabled, this sets the minimum delay (in seconds) between autovacuum runs on any given database.
VACUUM or ANALYZE commands for tables as needed, based on system catalogs and auxiliary statistics.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | 60 | 1 ~ (INT_MAX/1000) | master; system; restart |
Sets the cost delay value (in milliseconds) used in automatic VACUUM operations.
vacuum_cost_delay is specified, its value is used.2.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| floating point | 2 | -1 ~ 100 | segments; system; reload |
Sets the cost limit used in automatic VACUUM operations.
-1 is specified (the default), the value of vacuum_cost_limit is used.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | -1 | -1 ~ 10000 | segments; system; reload |
Specifies a fraction of the table size to be added to autovacuum_vacuum_threshold when determining whether to trigger a VACUUM.
0.2 (20% of table size).| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| floating point | 0.2 | 0.0 ~ 1.0 | segments; system; reload |
Sets the minimum number of updated or deleted tuples in a table that triggers a VACUUM.
| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | 50 | 1 ~ INT_MAX | segments; system; reload |
Logs each autovacuum action if the operation runs for at least the specified duration (in milliseconds).
0 logs all autovacuum actions.-1 (the default) disables logging of autovacuum actions.1000 logs all autovacuum and analyze operations that run for 1 second or longer.-1, a message is logged if an autovacuum action is skipped due to lock contention or a concurrently dropped relation.| Data Type | Default Value | Range | Setting Scope |
|---|---|---|---|
| int | -1 | -1 ~ INT_MAX | segments; system; reload |
Enables collection of statistics about database activity.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | true | master; session; reload; superuser |