mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Add log_min_autovacuum_duration per-table option
This is useful to control autovacuum log volume, for situations where monitoring only a set of tables is necessary. Author: Michael Paquier Reviewed by: A team led by Naoya Anzai (also including Akira Kurosawa, Taiki Kondo, Huong Dangminh), Fujii Masao.
This commit is contained in:
@@ -2493,6 +2493,7 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
|
||||
int multixact_freeze_table_age;
|
||||
int vac_cost_limit;
|
||||
int vac_cost_delay;
|
||||
int log_min_duration;
|
||||
|
||||
/*
|
||||
* Calculate the vacuum cost parameters and the freeze ages. If there
|
||||
@@ -2515,6 +2516,11 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
|
||||
? autovacuum_vac_cost_limit
|
||||
: VacuumCostLimit;
|
||||
|
||||
/* -1 in autovac setting means use log_autovacuum_min_duration */
|
||||
log_min_duration = (avopts && avopts->log_min_duration >= 0)
|
||||
? avopts->log_min_duration
|
||||
: Log_autovacuum_min_duration;
|
||||
|
||||
/* these do not have autovacuum-specific settings */
|
||||
freeze_min_age = (avopts && avopts->freeze_min_age >= 0)
|
||||
? avopts->freeze_min_age
|
||||
@@ -2545,6 +2551,7 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
|
||||
tab->at_params.multixact_freeze_min_age = multixact_freeze_min_age;
|
||||
tab->at_params.multixact_freeze_table_age = multixact_freeze_table_age;
|
||||
tab->at_params.is_wraparound = wraparound;
|
||||
tab->at_params.log_min_duration = log_min_duration;
|
||||
tab->at_vacuum_cost_limit = vac_cost_limit;
|
||||
tab->at_vacuum_cost_delay = vac_cost_delay;
|
||||
tab->at_relname = NULL;
|
||||
|
||||
Reference in New Issue
Block a user