postgresqlvacuum
This is an old revision of the document!
select relname, n_live_tup, n_dead_tup,
floor(current_setting('autovacuum_vacuum_threshold')::integer +
(current_setting('autovacuum_vacuum_scale_factor')::numeric *
(n_live_tup))) as "Autovacuum Threshold",
round(n_dead_tup / floor(current_setting('autovacuum_vacuum_threshold')::integer +
(current_setting('autovacuum_vacuum_scale_factor')::numeric *
(n_live_tup)))*100,2) as "Percentage",
last_vacuum, last_autovacuum
from pg_stat_user_tables
where n_live_tup > 0
order by 5 desc limit 10;
postgresqlvacuum.1631996538.txt.gz · Last modified: (external edit)
