| The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide
by The PostgreSQL Global Development Group Paperback (6"x9"), 274 pages ISBN 9781906966072 RRP £9.95 ($14.95) Sales of this book support the PostgreSQL project! Get a printed copy>>> |
4.9 Automatic Vacuuming
These settings control the behavior of the autovacuum feature. Refer to section 9.1.5 The Autovacuum Daemon for more information.
autovacuum(boolean)-
Controls whether the server should run the
autovacuum launcher daemon. This is on by default; however,
track_countsmust also be enabled for autovacuum to work. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. Note that even when this parameter is disabled, the system will launch autovacuum processes if necessary to prevent transaction ID wraparound. See section 9.1.4 Preventing Transaction ID Wraparound Failures for more information. log_autovacuum_min_duration(integer)-
Causes each action executed by autovacuum to be logged if it ran for at
least the specified number of milliseconds. Setting this to zero logs
all autovacuum actions. Minus-one (the default) disables logging
autovacuum actions. For example, if you set this to
250msthen all automatic vacuums and analyzes that run 250ms or longer will be logged. Enabling this parameter can be helpful in tracking autovacuum activity. This setting can only be set in the ‘postgresql.conf’ file or on the server command line. autovacuum_max_workers(integer)- Specifies the maximum number of autovacuum processes (other than the autovacuum launcher) which may be running at any one time. The default is three. This parameter can only be set at server start.
autovacuum_naptime(integer)-
Specifies the minimum delay between autovacuum runs on any given
database. In each round the daemon examines the
database and issues
VACUUMandANALYZEcommands as needed for tables in that database. The delay is measured in seconds, and the default is one minute (1min). This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. autovacuum_vacuum_threshold(integer)-
Specifies the minimum number of updated or deleted tuples needed
to trigger a
VACUUMin any one table. The default is 50 tuples. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. This setting can be overridden for individual tables by changing storage parameters. autovacuum_analyze_threshold(integer)-
Specifies the minimum number of inserted, updated or deleted tuples
needed to trigger an
ANALYZEin any one table. The default is 50 tuples. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. This setting can be overridden for individual tables by changing storage parameters. autovacuum_vacuum_scale_factor(floating point)-
Specifies a fraction of the table size to add to
autovacuum_vacuum_thresholdwhen deciding whether to trigger aVACUUM. The default is 0.2 (20% of table size). This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. This setting can be overridden for individual tables by changing storage parameters. autovacuum_analyze_scale_factor(floating point)-
Specifies a fraction of the table size to add to
autovacuum_analyze_thresholdwhen deciding whether to trigger anANALYZE. The default is 0.1 (10% of table size). This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. This setting can be overridden for individual tables by changing storage parameters. autovacuum_freeze_max_age(integer)-
Specifies the maximum age (in transactions) that a table's
pg_class.relfrozenxidfield can attain before aVACUUMoperation is forced to prevent transaction ID wraparound within the table. Note that the system will launch autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. Vacuum also allows removal of old files from the ‘pg_clog’ subdirectory, which is why the default is a relatively low 200 million transactions. This parameter can only be set at server start, but the setting can be reduced for individual tables by changing storage parameters. For more information see section 9.1.4 Preventing Transaction ID Wraparound Failures. autovacuum_vacuum_cost_delay(integer)-
Specifies the cost delay value that will be used in automatic
VACUUMoperations. If-1is specified, the regularvacuum_cost_delayvalue will be used. The default value is 20 milliseconds. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. This setting can be overridden for individual tables by changing storage parameters. autovacuum_vacuum_cost_limit(integer)-
Specifies the cost limit value that will be used in automatic
VACUUMoperations. If-1is specified (which is the default), the regularvacuum_cost_limitvalue will be used. Note that the value is distributed proportionally among the running autovacuum workers, if there is more than one, so that the sum of the limits of each worker never exceeds the limit on this variable. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. This setting can be overridden for individual tables by changing storage parameters.
| ISBN 9781906966072 | The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide | See the print edition |