Top
Enterprise Postgres 17 Operation Guide

9.7.3 Tuning the Allocation Time for Aggressive Freeze for Tuples

The interval between autovacuum runs is treated as one interval, and aggressive freeze for tuples is scheduled to be completed before the next autovacuum run. For example, if your environment is one week where freezing by autovacuum occurs, determine the required time within that interval.

Calculate the time required for aggressive freeze for tuples as follows, based on the time it took to freeze transaction IDs by past autovacuums stored in the pgx_stat_freeze_results table for each database you are using.

In this example, the interval for autovacuum freezing is set to one week. Perform this for each database you operate and calculate the total.

# SELECT sum(total_elapsed_time) - sum(sleep_times) as total_time FROM pgx_stat_freeze_results WHERE measurement_start_time >= '2024/10/21 00:00:00' AND measurement_end_time < '2024/10/28 00:00:00' AND autovacuum = true;

If you are unable to secure sufficient time when the workload is low, increase the degree of parallelism. You can specify the degree of parallelism in the script.