Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9FAEC1337B63 for ; Wed, 8 Dec 2010 15:01:09 -0400 (AST) 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 46702-03 for ; Wed, 8 Dec 2010 19:01:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail148107.authsmtp.com (outmail148107.authsmtp.com [62.13.148.107]) by mail.postgresql.org (Postfix) with ESMTP id BFDC41337B54 for ; Wed, 8 Dec 2010 15:01:01 -0400 (AST) Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt2.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id oB8J0xOo076792; Wed, 8 Dec 2010 19:00:59 GMT Received: from [192.168.0.6] ([81.5.146.37]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id oB8J0qgn052899; Wed, 8 Dec 2010 19:00:53 GMT Subject: Re: Group commit and commit delay/siblings From: Simon Riggs To: Greg Smith Cc: Jignesh Shah , Tom Lane , Rob Wultsch , postgres performance list In-Reply-To: <4CFDBDA2.4050705@2ndquadrant.com> References: <4CFC6814.9010002@2ndquadrant.com> <28624.1291658109@sss.pgh.pa.us> <4CFDBDA2.4050705@2ndquadrant.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 08 Dec 2010 19:00:52 +0000 Message-ID: <1291834852.2872.1168.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: 7b22760c-02fd-11e0-97bb-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksacxtFaA1baVxS HGQLWlREUVR7WWN/ bgkfZQRDZ1RPWwN0 U09WR1pVCwUmXm4J fB5fBUdycgdOcXc+ ZEdjXXUVWxZ4d0F7 Qh1JFW9QMXphaTUf TUlfJVFJcANIfBlB Y1d3UXIFLwdSbGoL JyIJERcLGAAXBz5S XxlFJlUXREcXVjc6 S1gJGjAqHFFNSyg3 Jg1hMV8WGEcXPV5a X-Authentic-SMTP: 61633235383639.1014: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=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201012/107 X-Sequence-Number: 41559 On Mon, 2010-12-06 at 23:52 -0500, Greg Smith wrote: > Jignesh Shah wrote: > > On Tue, Dec 7, 2010 at 1:55 AM, Tom Lane wrote: > > > >> I could have sworn we'd refactored that to something like > >> bool ThereAreAtLeastNActiveBackends(int n) > >> which could drop out of the loop as soon as it'd established what we > >> really need to know...I'd suggest that we just improve the > >> coding so that we don't scan ProcArray at all when commit_siblings is 0. > >> > >> (I do agree with improving the docs to warn people away from assuming > >> this is a knob to frob mindlessly.) > >> > > In that case I propose that we support commit_siblings=0 which is not > > currently supported. Minimal value for commit_siblings is currently > > 1. If we support commit_siblings=0 then it should short-circuit that > > function call which is often what I do in my tests with commit_delay. > > > > Everybody should be happy now: attached patch refactors the code to > exit as soon as the siblings count is exceeded, short-circuits with no > scanning of ProcArray if the minimum is 0, and allows setting the > siblings to 0 to enable that shortcut: Minor patch, no downsides. Docs checked. Committed. -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services