why does the transaction age of template0 DB increase while it is never been used?
datname | age |
----------------------+-----------+
template0 | 192232070
why does the transaction age of template0 DB increase while it is never been used?
datname | age |
----------------------+-----------+
template0 | 192232070
Every database has a datfrozenxid in its pg_database entry. This is identical to the minimum relfrozenxid of the pg_class entries of all tables in the database.
Whenever VACUUM freezes tuples in a table, it can advance these columns.
There is no real need to vacuum template0 regularly. However, even in that database a table receives an anti-wraparound autovacuum run whenever its relfrozenxid becomes older than autovacuum_freeze_max_age. This will be done very quickly: PostgreSQL will see in the visibility map that all pages are “all frozen” and advance relfrozenxid.
This is no real problem, so nobody sees a need to change or optimize that.