Transaction Metrics
The Transaction metrics group provides details on:
- Oldest transaction ID
- Percent towards emergency vacuum & wraparound
- Percent towards the transaction ID wrapping around
- Percent towards an emergency vacuum
Oldest Transaction ID
It provides a historical view of the transaction ID (XID).
Percent towards emergency vacuum & wraparound
Percent Towards Emergency Vacuum
It provides historical data on how close an emergency vacuum is to being triggered. Related to preventing transaction wraparounds, Postgresql will attempt to trigger an emergency vacuum operation if it is approaching a wraparound scenario (by default, this is when 200 million transactions are still “active” / unfrozen).
For further details, see the official documentation.
Percent Towards Wraparound
It provides historical data on whether a transaction wraparound is imminent. PostgreSQL’s concurrency control relies on being able to compare the ordering of transactions against each other, using the transaction ID. However, as the transaction ID has a limited size periodic vacuums are required to mark sufficiently older transactions as frozen (i.e. will always be compared as older than current and future transactions).
If this metric is consistently growing without periodically shrinking, it may indicate that the database is blocked from performing vacuum operations on one or more tables.
For further details, see the official documentation.