Top
Enterprise Postgres 17 Operation Guide

9.7.1 Monitoring Trends in Transaction ID Usage

Execute the following SQL to monitor the trend in transaction ID usage.

# SELECT max(age(datfrozenxid)) FROM pg_database WHERE datallowconn = true;

If autovacuum does not sufficiently reduce transaction ID usage, schedule aggressive freeze for tuples.

Determine whether the amount of waste reduced by automatic vacuum is sufficient

Looking at the entire interval that includes several autovacuum freeze processes, the transaction ID usage will be graphed like a sawtooth, sandwiching the autovacuum_freeze_max_age setting value, depending on the start and end of the autovacuum operation. If the usage peaks are gradually getting larger, the reduction may be insufficient. In particular, if it no longer falls below autovacuum_freeze_max_age, the reduction is definitely insufficient.