19.11. Background Freezer #

These settings control the behavior of background freezer. Refer to Section 24.2 for more information.

enable_background_freezer (boolean) #

Enables or disables sending messages to the background freezer worker using a UDP socket. This configuration parameter can be set either in the postgresql.conf file or in a session by superusers. The default value is off.

bgfreezer_pages_per_rel_to_clean (integer) #

Sets the number of pages that the background freezer worker accumulates in a queue for each table to start vacuuming. For example, if bgfreezer_pages_per_rel_to_clean=128, the worker accumulates at least 128 pages in a queue and starts processing them after the transaction is completed. When set to 0, queued pages start to be processed at the end of each transaction. This configuration parameter can be set either in the postgresql.conf file or by sending the SIGHUP signal to the main server process. The default value is 128.

bgfreezer_max_pages_per_rel (integer) #

Sets the maximum number of pages that can be queued for vacuuming per table. When this number is reached, page accumulation stops and new pages evict old pages from the queue. This configuration parameter can be set either in the postgresql.conf file or by sending the SIGHUP signal to the main server process. The default value is 32768.

bgfreezer_log (integer) #

Sets background freezer logging rules. Possible values are:

  • 0: logging is disabled.

  • 1: page and tuple statistics is logged after processing each queue for vacuuming and freezing.

  • 2: page and tuple statistics is logged after processing every other queue for vacuuming and freezing. In this case, the output in the log contains information accumulated during processing of two queues, except for values value_2 and value_3, which are returned for the last processed queue and reflect the current queue state.

If bgfreezer_log is enabled, background freezer logs messages in the following form:

LOG:  background freezer: value_1 pages processed (value_2 non-unique; value_3 left), value_4 frozen, value_5 all visible; value_6 tuples frozen; value_7 tuples deleted.

The values represent the following:

  • value_1: the number of processed pages.

  • value_2: the number of processed non-unique pages queued for vacuuming and freezing when processing the last queue. Generally, this value does not match value_1, since pages may have duplicates. In such cases only the first occurrence of a page is processed.

  • value_3: the number of pages left after the last queue is processed for vacuuming and freezing.

  • value_4: the number of frozen pages.

  • value_5: the number of pages marked as all-visible.

  • value_6: the number of frozen tuples on pages.

  • value_7: the number of deleted tuples on pages.

Each time background freezer emits the message to the log, it resets the counter of pages and tuples listed above.

This configuration parameter can be set either in the postgresql.conf file or by sending the SIGHUP signal to the main server process. The default value is 0.