PostgreSQL 11 Administration Cookbook
by Simon Riggs, Gianni Ciolli, Sudheer Kumar Meesala, Sheldon Strauch
Getting ready
autovacuum_max_workers should always be set to more than 2. Setting it too high may not be very useful, and so you need to be careful.
Setting vacuum_cost_delay too high is counterproductive. VACUUM is your friend, not your enemy, so delaying it until it doesn't happen at all just makes things worse.
maintenance_work_mem should be set to anything up to 1 GB, according to how much memory you can allocate to this task at this time.
Let's watch what happens when we run a large VACUUM. Don't run VACUUM FULL, because it runs for a long time while holding an AccessExclusiveLock on the table.
First, locate which process is running the VACUUM by using the pg_stat_activity view to identify the specific pid (34399 is just an example). ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access