Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id BB82F9FB4E2 for ; Thu, 21 Jun 2007 14:10:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 10097-03 for ; Thu, 21 Jun 2007 14:09:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by postgresql.org (Postfix) with ESMTP id 16A999FB4CB for ; Thu, 21 Jun 2007 14:09:58 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id s16so528248wxc for ; Thu, 21 Jun 2007 10:09:57 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=RBDjX6xLqaZ72T+psNqSeA3y9N+MfywsfIda9mwo4pkIWUXf7PIvWxtQ3WLy3ULSFA9ihAynHlooxUzvXOJdtk3AyXak/B69C4skKs1JYLHGx/+K1roVp8/SU9NxZV/U3gQNvM+qptZb/j+fKEiELm8TZEt+/+WZA5FIMgUFFo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=hDMPNdBqdNPiFhfe2IWb2BDdm2myf/aixMQsfTMJk4z05+9YBkSrrJAi+kJRK5kWKY4axN8QZWn6iWdQQVHP7m9CbvDEFAkkenC/az/2TAZhAHc1b0gxc5oYMcU2TJ7iAISALp7Vy/pF/BpQrJFPz9VIY4DiaGKeAwNlqqcbFGc= Received: by 10.70.47.19 with SMTP id u19mr3322457wxu.1182445797405; Thu, 21 Jun 2007 10:09:57 -0700 (PDT) Received: by 10.70.109.14 with HTTP; Thu, 21 Jun 2007 10:09:57 -0700 (PDT) Message-ID: <357fa7590706211009w2ef6071fn83c5759db6be1e80@mail.gmail.com> Date: Thu, 21 Jun 2007 13:09:57 -0400 From: "Steven Flatt" To: pgsql-performance@postgresql.org Subject: Database-wide VACUUM ANALYZE MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_106877_24891419.1182445797380" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL=-1.341, BAYES_50=0.001, HTML_10_20=1.351, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200706/475 X-Sequence-Number: 25508 ------=_Part_106877_24891419.1182445797380 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline We recently upgraded a very large database (~550 GB) from 8.1.4 to 8.2.4 via a pg_dump and pg_restore. (Note that the restore took several days.) We had accepted the default settings: vacuum_freeze_min_age = 100 million autovacuum_freeze_max_age = 200 million Due to our very high transaction rate, it appears that a database-wide vacuum kicked off approximately 2 weeks after the restore. (Aside: after reading the docs and considering our system characteristics, I know now that our autovacuum_freeze_max_age should be more like 2 billion. However on this machine I haven't changed the config settings yet.) Also, I believe, that due to the bulk of our data having the same "age" after the restore, the db-wide vacuum had *a lot* of rows to mark with the FrozenXID. The good thing is that the db-wide vacuum, which ran for a long time, was reasonably non-intrusive to other database activity (somewhat, but reasonable for the short term). The other good thing was that concurrent autovacuum processes were still vacuuming/analyzing tables as necessary. The bad thing, which I don't totally understand from reading the docs, is that another db-wide vacuum kicked off exactly 24 hours after the first db-wide vacuum kicked off, before the first one had finished. (Note that these vacuums seem to go through the tables alphabetically.) I managed to explain this to myself in that there were still rows in tables not yet touched by the first db-wide vacuum that could have XIDs older than autovacuum_freeze_max_age. Fine, so two db-wide vacuums were now taking place, one behind the other. The first db-wide vacuum finished approximately 36 hours after it started. At this point I was convinced that the second db-wide vacuum would run to completion with little or no work to do and all would be good. The thing I can't explain is why a third db-wide vacuum kicked off exactly 24 hours (again) after the second db-wide vacuum kicked off (and the second vacuum still running). Wouldn't the first db-wide vacuum have marked any rows that needed it with the FrozenXID? Why would a third db-wide vacuum kick off so soon after the first db-wide vacuum had completed? Surely there haven't been 100 million more transactions in the last two days? Can someone explain what is going on here? I can't quite figure it out based on the docs. Thanks, Steve ------=_Part_106877_24891419.1182445797380 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
We recently upgraded a very large database (~550 GB) from 8.1.4 to 8.2.4 via a pg_dump and pg_restore.  (Note that the restore took several days.)  We had accepted the default settings:
 
vacuum_freeze_min_age = 100 million
autovacuum_freeze_max_age = 200 million
 
Due to our very high transaction rate, it appears that a database-wide vacuum kicked off approximately 2 weeks after the restore.  (Aside: after reading the docs and considering our system characteristics, I know now that our autovacuum_freeze_max_age should be more like 2 billion.  However on this machine I haven't changed the config settings yet.)  Also, I believe, that due to the bulk of our data having the same "age" after the restore, the db-wide vacuum had *a lot* of rows to mark with the FrozenXID.
 
The good thing is that the db-wide vacuum, which ran for a long time, was reasonably non-intrusive to other database activity (somewhat, but reasonable for the short term).  The other good thing was that concurrent autovacuum processes were still vacuuming/analyzing tables as necessary.
 
The bad thing, which I don't totally understand from reading the docs, is that another db-wide vacuum kicked off exactly 24 hours after the first db-wide vacuum kicked off, before the first one had finished.  (Note that these vacuums seem to go through the tables alphabetically.)  I managed to explain this to myself in that there were still rows in tables not yet touched by the first db-wide vacuum that could have XIDs older than autovacuum_freeze_max_age.  Fine, so two db-wide vacuums were now taking place, one behind the other.
 
The first db-wide vacuum finished approximately 36 hours after it started.  At this point I was convinced that the second db-wide vacuum would run to completion with little or no work to do and all would be good.  The thing I can't explain is why a third db-wide vacuum kicked off exactly 24 hours (again) after the second db-wide vacuum kicked off (and the second vacuum still running).
 
Wouldn't the first db-wide vacuum have marked any rows that needed it with the FrozenXID?  Why would a third db-wide vacuum kick off so soon after the first db-wide vacuum had completed?  Surely there haven't been 100 million more transactions in the last two days?
 
Can someone explain what is going on here?  I can't quite figure it out based on the docs.
 
Thanks,
Steve
 
------=_Part_106877_24891419.1182445797380--