Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 10DB71337B8A for ; Mon, 7 Feb 2011 19:49:46 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 25247-07 for ; Mon, 7 Feb 2011 23:49:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id D27401336971 for ; Mon, 7 Feb 2011 19:49:38 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id B95B114A5; Mon, 7 Feb 2011 18:49:37 -0500 (EST) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3y62PKxVjzhe; Mon, 7 Feb 2011 18:49:36 -0500 (EST) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id 99D5E19; Mon, 7 Feb 2011 18:49:35 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 24531AE371; Tue, 8 Feb 2011 07:49:34 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id aOoKsn6v8hfw; Tue, 8 Feb 2011 07:49:28 +0800 (WST) Received: from [10.1.1.5] (124-168-239-98.dyn.iinet.net.au [124.168.239.98]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 5FFD8AE30A; Tue, 8 Feb 2011 07:49:28 +0800 (WST) Message-ID: <4D508507.8010306@postnewspapers.com.au> Date: Tue, 08 Feb 2011 07:49:27 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: Marti Raudsepp CC: felix , "pgsql-performance@postgresql.org" Subject: Re: Really really slow select count(*) References: <4D4C138C.7010304@2ndquadrant.com> <4D4C1555.40209@peak6.com> <4D4C2AC3.5020804@peak6.com> <4D4F6109.1090209@postnewspapers.com.au> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/292 X-Sequence-Number: 42430 On 02/07/2011 06:30 PM, Marti Raudsepp wrote: > On Mon, Feb 7, 2011 at 05:03, Craig Ringer wrote: >> What would possibly help would be if Pg could fall back to lower >> shared_buffers automatically, screaming about it in the logs but still >> launching. OTOH, many people don't check the logs, so they'd think their >> new setting had taken effect and it hadn't - you've traded one usability >> problem for another. Even if Pg issued WARNING messages to each client >> that connected, lots of (non-psql) clients don't display them, so many >> users would never know. >> >> Do you have a suggestion about how to do this better? The current >> approach is known to be rather unlovely, but nobody's come up with a >> better one that works reasonably and doesn't trample on other System V >> shared memory users that may exist on the system. > > We could do something similar to what Apache does -- provide distros > with a binary to check the configuration file in advance. This check > program is launched before the "restart" command, and if it fails, the > server is not restarted. That would work for config file errors (and would probably be a good idea) but won't help with bad shared memory configuration. When Pg is already running, it's usually not possible for a test program to claim the amount of shared memory the config file says to allocate, because Pg is already using it. Nonetheless, Pg will work fine when restarted. -- Craig Ringer