Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 21E551337B67 for ; Fri, 15 Oct 2010 10:49:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 42238-04 for ; Fri, 15 Oct 2010 13:49:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149078.authsmtp.net (outmail149078.authsmtp.net [62.13.149.78]) by mail.postgresql.org (Postfix) with ESMTP id 5C20B1336DB6 for ; Fri, 15 Oct 2010 10:49:02 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id o9FDn1HS059652; Fri, 15 Oct 2010 14:49:01 +0100 (BST) Received: from [10.8.0.139] (host217-37-44-41.in-addr.btopenworld.com [217.37.44.41]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id o9FDmv1L065473; Fri, 15 Oct 2010 14:48:57 +0100 (BST) Subject: Re: formula about the number of WAL files From: Simon Riggs To: Fujii Masao Cc: pgsql-docs In-Reply-To: References: <1287134396.1725.1300.camel@ebony> Content-Type: text/plain; charset="UTF-8" Date: Fri, 15 Oct 2010 14:48:57 +0100 Message-ID: <1287150537.1725.1452.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: f57b1538-d862-11df-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaQBbYlpF HGQLWlREUVl7XWt/ bgIfbwRafElJQQFu TkxIXVdaExpoT0MI cGpDFBgOdwNDfHlz K0RrX3IVCkF9J0d4 QUZJQWUAZ3phaTRJ TUhYJQpJcANIfBlB agJ3XHBYLwdSbGoL MygYBAV5MzJFLTlR S0kEJ1UPXQ4XHjN0 QQ0HFzg1VUoLDxoa C1QoK1oRBy4A X-Authentic-SMTP: 61633235383639.1015:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201010/40 X-Sequence-Number: 6181 On Fri, 2010-10-15 at 19:44 +0900, Fujii Masao wrote: > As the result of the above, the maximum number of WAL files in > pg_xlog is > > (2 + checkpoint_completion_target) * checkpoint_segments + 1 > > or > > wal_keep_segments + checkpoint_segments + 1 > > So the original description seems to be correct. Am I missing > something? After some thought, I agree. > # My previous proposal is definitely wrong. Sorry for noise. I'd say the definition of wal_keep_segments isn't good, which is what is causing the problem here. Will sort that out another day. I will update the current code with some comments, so this doesn't happen again. Will do this on Tuesday now, no time left here. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Training and Services