<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Robert Haas: vacuum</title><description>Sr. Staff Software Engineer @ Databricks, PostgreSQL Developer and Committer</description><link>https://rhaas.dev/</link><item><title>Updating the Cost Limit On The Fly</title><link>https://rhaas.dev/blog/2023/04/updating-cost-limit-on-fly/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-7046303517326467636</guid><description>&lt;p&gt;Rejoice and be glad! I was so pleased this morning to see that &lt;a href=&quot;https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=7d71d3dd080b9b147402db3365fe498f74704231&quot;&gt;Melanie Plageman’s patch to make autovacuum absorb new cost limit settings more quickly&lt;/a&gt; was committed by Daniel Gustafsson while I was busy enjoying a long Easter weekend. It’s a minor change in the grand scheme of things, but there’s a reasonably common situation where it’s going to make life a lot easier.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2023/04/updating-cost-limit-on-fly/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 10 Apr 2023 15:14:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>Useless Vacuuming</title><link>https://rhaas.dev/blog/2020/02/useless-vacuuming/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-8802596788016288360</guid><description>&lt;p&gt;In &lt;a href=&quot;/blog/tags/vacuum/&quot;&gt;previous blog posts that I’ve written about VACUUM&lt;/a&gt;, and I seem to be accumulating an uncomfortable number of those, I’ve talked about various things that can go wrong with vacuum, but one that I haven’t really covered is when autovacuum seems to be running totally normally but you still have a VACUUM problem. In this blog post, I’d like to talk about how to recognize that situation, how to figure out what has caused it, how to avoid it via good monitoring, and how to recover if it happens.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2020/02/useless-vacuuming/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Thu, 13 Feb 2020 19:13:00 GMT</pubDate><category>postgresql</category><category>troubleshooting</category><category>vacuum</category></item><item><title>Tuning autovacuum_naptime</title><link>https://rhaas.dev/blog/2019/02/tuning-autovacuumnaptime/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-2813991733788568598</guid><description>&lt;p&gt;One of the things I sometimes get asked to do is review someone’s postgresql.conf settings. From time to time, I run across a configuration where the value of &lt;a href=&quot;https://www.postgresql.org/docs/current/runtime-config-autovacuum.html#GUC-AUTOVACUUM-NAPTIME&quot;&gt;autovacuum_naptime&lt;/a&gt; has been increased, often by a large multiple. The default value of autovacuum_naptime is 1 minute, and I have seen users increase this value to 1 hour, or in one case, 1 day. This is not a good idea. In this blog post, I will attempt to explain why it’s not a good idea, and also something about the limited circumstances under which you might want to change autovacuum_naptime.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2019/02/tuning-autovacuumnaptime/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 18 Feb 2019 15:23:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>How Much maintenance_work_mem Do I Need?</title><link>https://rhaas.dev/blog/2019/01/how-much-maintenanceworkmem-do-i-need/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-8402094424846359872</guid><description>&lt;p&gt;While I generally like PostgreSQL’s documentation quite a bit, there are some areas where it is not nearly specific enough for users to understand what they need to do. The documentation for maintenance_work_mem is one of those places. It &lt;a href=&quot;https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM&quot;&gt;says&lt;/a&gt;, and I quote, “Larger settings might improve performance for vacuuming and for restoring database dumps,” but that isn’t really very much help, because if it might improve performance, it also might not improve performance, and you might like to know which is the case before deciding to raise the value, so that you don’t waste memory. TL;DR: Try maintenance_work_mem = 1GB. Read on for more specific advice.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2019/01/how-much-maintenanceworkmem-do-i-need/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Thu, 24 Jan 2019 17:04:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>DO or UNDO - there is no VACUUM</title><link>https://rhaas.dev/blog/2018/01/do-or-undo-there-is-no-vacuum/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-2141022092022260621</guid><description>&lt;p&gt;What if PostgreSQL didn’t need VACUUM at all? This seems hard to imagine. After all, PostgreSQL uses multi-version concurrency control (MVCC), and if you create multiple versions of rows, &lt;a href=&quot;/blog/2017/12/mvcc-and-vacuum/&quot;&gt;you have to eventually get rid of the row versions somehow&lt;/a&gt;. In PostgreSQL, VACUUM is in charge of making sure that happens, and the autovacuum process is in charge of making sure that happens soon enough. Yet, other schemes are possible, as shown by the fact that &lt;a href=&quot;http://amitkapila16.blogspot.com/2015/03/different-approaches-for-mvcc-used-in.html&quot;&gt;not all relational databases handle MVCC in the same way&lt;/a&gt;, and there are reasons to believe that PostgreSQL could benefit significantly from adopting a new approach. In fact, many of my colleagues at EnterpriseDB are busy implementing a new approach, and today I’d like to tell you a little bit about what we’re doing and why we’re doing it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2018/01/do-or-undo-there-is-no-vacuum/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 30 Jan 2018 13:37:00 GMT</pubDate><category>postgresql</category><category>vacuum</category><category>zheap</category></item><item><title>The State of VACUUM</title><link>https://rhaas.dev/blog/2018/01/the-state-of-vacuum/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-1315582244504944549</guid><description>&lt;p&gt;In &lt;a href=&quot;/blog/2017/12/mvcc-and-vacuum/&quot;&gt;a recent blog post&lt;/a&gt;, I talked about why every system that implements MVCC needs some scheme for removing old row versions, and how VACUUM meets that need for PostgreSQL. In this post, I’d like to examine the history of VACUUM improvements in recent years, the state of VACUUM as it exists in PostgreSQL today, and how it might be improved in the future.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2018/01/the-state-of-vacuum/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Fri, 05 Jan 2018 18:34:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>MVCC and VACUUM</title><link>https://rhaas.dev/blog/2017/12/mvcc-and-vacuum/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-5476465470109771264</guid><description>&lt;p&gt;Experienced PostgreSQL users and developers rattle off the terms “MVCC” and “VACUUM” as if everyone should know what they are and how they work, but in fact many people don’t. This blog post is my attempt to explain what MVCC is and why PostgreSQL uses it, what VACUUM is and how it works, and why we need VACUUM to implement MVCC. In addition, I’ll include a few useful links for further reading for those who may want to know more.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2017/12/mvcc-and-vacuum/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Mon, 18 Dec 2017 14:35:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>No More Full-Table Vacuums</title><link>https://rhaas.dev/blog/2016/03/no-more-full-table-vacuums/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-4575083428859373352</guid><description>&lt;p&gt;I just committed a very important patch to PostgreSQL. The short summary for the patch is “&lt;a href=&quot;http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fd31cd265138019dcccc9b5fe53043670898bc9f&quot;&gt;Don’t vacuum all-frozen pages.&lt;/a&gt;” and it follows up on a patch I committed last week, whose short summary was “&lt;a href=&quot;http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a892234f830e832110f63fc0a2afce2fb21d1584&quot;&gt;Change the format of the VM fork to add a second bit per page.&lt;/a&gt;” This led Andres Freund to &lt;a href=&quot;http://www.postgresql.org/message-id/20160310212226.nhcrxsx7syja77nn@alap3.anarazel.de&quot;&gt;respond with a one word email&lt;/a&gt;: “Yeha!”&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2016/03/no-more-full-table-vacuums/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Thu, 10 Mar 2016 21:56:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>VACUUM FULL doesn&apos;t mean &quot;VACUUM, but better&quot;</title><link>https://rhaas.dev/blog/2014/03/vacuum-full-doesnt-mean-vacuum-but/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-4045564237208311401</guid><description>&lt;p&gt;There’s a persistent belief among some users of PostgreSQL that VACUUM and VACUUM FULL do the same thing, but that VACUUM FULL does it better. If VACUUM is the moral equivalent of running the Dust Buster across the room a few times, VACUUM FULL must be the equivalent of hiring a professional cleaning crew to shampoo the carpets, and maybe repaint the walls as well. Unfortunately, this mental model is not accurate.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2014/03/vacuum-full-doesnt-mean-vacuum-but/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 04 Mar 2014 21:00:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>Unsticking VACUUM</title><link>https://rhaas.dev/blog/2011/11/unsticking-vacuum/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-5522648582512547739</guid><description>&lt;p&gt;Every PostgreSQL release adds new features, but sometimes the key to a release has less to do with what you add than with what you take away. PostgreSQL 8.4, for example, removed the settings max_fsm_pages and max_fsm_relations, and replaced them with a per-relation free space map that no longer requires manual sizing. Those parameters are now gone, and more importantly, something that you previously needed to understand and manage was replaced with something that just works. People who are still running PostgreSQL 8.3, or older versions, want to understand exactly how the free space map works; people who are running PostgreSQL 8.4, or newer, don’t care. It’s enough to know that it does work.&lt;/p&gt;
&lt;p&gt;Now, about eight months ago, I wrote a blog entry on &lt;a href=&quot;/blog/2011/03/troubleshooting-stuck-vacuums/&quot;&gt;troubleshooting stuck vacuums&lt;/a&gt;. I would not say that this is an everyday problem, but in ten years of working with PostgreSQL, I’ve seen it a few times, and it’s very unpleasant. It’s easy to miss the fact that you have a problem at all, because in most cases, nothing immediately breaks. Instead, system performance just slowly degrades, gradually enough that you may not realize what the problem is until things have gotten pretty bad and you need to CLUSTER or VACUUM FULL to recover.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2011/11/unsticking-vacuum/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Thu, 10 Nov 2011 18:41:00 GMT</pubDate><category>postgresql</category><category>vacuum</category></item><item><title>Troubleshooting Stuck VACUUMs</title><link>https://rhaas.dev/blog/2011/03/troubleshooting-stuck-vacuums/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-6714697268167828259</guid><description>&lt;p&gt;Over the years, I’ve occasionally encountered situations where VACUUM fails to make progress, and not fully understood why that was happening. Recently, I’ve come to a better understanding of how lock conflicts can result in VACUUM stalling out either at the beginning of the table, or part-way through. (If you’re not already familiar with the types of locks that PostgreSQL uses, you may find it helpful to read through my earlier blog post on &lt;a href=&quot;/blog/2011/01/locking-in-postgresql/&quot;&gt;locking in PostgreSQL&lt;/a&gt; before reading on.)&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2011/03/troubleshooting-stuck-vacuums/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 01 Mar 2011 15:04:00 GMT</pubDate><category>postgresql</category><category>troubleshooting</category><category>vacuum</category></item><item><title>MySQL vs. PostgreSQL, Part 2: VACUUM vs. Purge</title><link>https://rhaas.dev/blog/2011/02/mysql-vs-postgresql-part-2-vacuum-vs/</link><guid isPermaLink="false">tag:blogger.com,1999:blog-20038672.post-3894785987764305435</guid><description>&lt;p&gt;Almost two months ago, I wrote &lt;a href=&quot;/blog/2010/11/mysql-vs-postgresql-part-1-table/&quot;&gt;part one&lt;/a&gt; of what I indicated would be an occasional series of blog posts comparing the architecture of &lt;a href=&quot;http://www.postgresql.org/&quot;&gt;PostgreSQL&lt;/a&gt; to that of &lt;a href=&quot;http://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt;. Here’s part two. Please note that the caveats set forth in part one apply to this and all future installments as well, so if you haven’t read part one already, please click on the link above and read at least the first two paragraphs before reading this post.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://rhaas.dev/blog/2011/02/mysql-vs-postgresql-part-2-vacuum-vs/&quot;&gt;Read more »&lt;/a&gt;&lt;/p&gt;</description><pubDate>Tue, 01 Feb 2011 15:06:00 GMT</pubDate><category>mysql</category><category>postgresql</category><category>vacuum</category></item></channel></rss>