Skip to content

Measure Vacuum Time as a percentage of TXID wraparound time as a saturation metric

The Idea

On one hand, the total time taken to vacuum our postgres table is increasing, particularly due to some enormous unpartitioned table.s.

On the other hand, our transaction rate is increasing. This in turn decreases the time between transaction wraparound.

Critically, we need to be able to vacuum the entire database in less time than the transaction wraparound horizon.

Measuring as a saturation metric

We could measure this as a saturation metric: vacuum_time/wraparound_time. As vacuum time tends up (due to bigger unpartitioned tables) and wraparound time tends down (due to faster transaction rates), these will tend to 100%.

If we measure this ratio as a saturation metric, we can plan accordingly.

cc @abrandl @msmiley @NikolayS @Finotto

Edited by Andrew Newdigate