postgresql/src/backend/postmaster
Melanie Plageman 06eae9e621 Trigger more frequent autovacuums with relallfrozen
Calculate the insert threshold for triggering an autovacuum of a
relation based on the number of unfrozen pages.

By only considering the unfrozen portion of the table when calculating
how many tuples to add to the insert threshold, we can trigger more
frequent vacuums of insert-heavy tables. This increases the chances of
vacuuming those pages when they still reside in shared buffers

This also increases the number of autovacuums triggered by tuples
inserted and not by wraparound risk. We prefer to freeze these pages
during insert-triggered autovacuums, as anti-wraparound vacuums are not
automatically canceled by conflicting lock requests.

We calculate the unfrozen percentage of the table using the recently
added (99f8f3fbbc) relallfrozen column of pg_class.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com>
Reviewed-by: Robert Treat <rob@xzilla.net>
Reviewed-by: wenhui qiu <qiuwenhuifx@gmail.com>
Discussion: https://postgr.es/m/flat/CAAKRu_aj-P7YyBz_cPNwztz6ohP%2BvWis%3Diz3YcomkB3NpYA--w%40mail.gmail.com
2025-03-03 14:42:00 -05:00
..
autovacuum.c Trigger more frequent autovacuums with relallfrozen 2025-03-03 14:42:00 -05:00
auxprocess.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
bgworker.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
bgwriter.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
checkpointer.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
fork_process.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
interrupt.c Update copyright for 2025 2025-01-01 11:21:55 -05:00
launch_backend.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
Makefile Assign a child slot to every postmaster child process 2024-11-14 16:12:28 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgarch.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
pmchild.c Allow changing autovacuum_max_workers without restarting. 2025-01-06 15:01:22 -06:00
postmaster.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
startup.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
syslogger.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
walsummarizer.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00
walwriter.c backend launchers void * arguments for binary data 2025-02-21 08:03:33 +01:00