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.conffile or in a session by superusers. The default value isoff.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 to0, queued pages start to be processed at the end of each transaction. This configuration parameter can be set either in thepostgresql.conffile or by sending the SIGHUP signal to the main server process. The default value is128.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.conffile or by sending the SIGHUP signal to the main server process. The default value is32768.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 valuesvalue_2andvalue_3, which are returned for the last processed queue and reflect the current queue state.
If
bgfreezer_logis enabled, background freezer logs messages in the following form:LOG: background freezer:
value_1pages processed (value_2non-unique;value_3left),value_4frozen,value_5all visible;value_6tuples frozen;value_7tuples 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 matchvalue_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.conffile or by sending the SIGHUP signal to the main server process. The default value is0.