Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2AF371337B4A for ; Wed, 16 Feb 2011 12:28:46 -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 30314-02 for ; Wed, 16 Feb 2011 16:28:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cooker.cnx.rice.edu (cooker.cnx.rice.edu [168.7.5.70]) by mail.postgresql.org (Postfix) with ESMTP id 76A82133616B for ; Wed, 16 Feb 2011 12:28:38 -0400 (AST) Received: from reedstrm by cooker.cnx.rice.edu with local (Exim 4.69) (envelope-from ) id 1PpkEy-0006mq-H6; Wed, 16 Feb 2011 10:28:32 -0600 Date: Wed, 16 Feb 2011 10:28:32 -0600 From: "Ross J. Reedstrom" To: Kevin Grittner Cc: Greg Smith , Scott Marlowe , felix , Marti Raudsepp , sthomas@peak6.com, "pgsql-performance@postgresql.org" , Maciek Sakrejda Subject: Re: Really really slow select count(*) Message-ID: <20110216162832.GA17015@rice.edu> References: <4D5151C6.7040109@peak6.com> <4D511C99020000250003A62D@gw.wicourts.gov> <4D51A304.4070003@2ndquadrant.com> <4D5166BF020000250003A672@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D5166BF020000250003A672@gw.wicourts.gov> User-Agent: Mutt/1.5.18 (2008-05-17) 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/412 X-Sequence-Number: 42550 On Tue, Feb 08, 2011 at 03:52:31PM -0600, Kevin Grittner wrote: > Scott Marlowe wrote: > > Greg Smith wrote: > > >> Kevin and I both suggested a "fast plus timeout then immediate" > >> behavior is what many users seem to want. > > > Are there any settings in postgresql.conf that would make it > > unsafe to use -m immediate? > > I don't think so. There could definitely be problems if someone > cuts power before your shutdown completes, though. (I hear that > those firefighters like to cut power to a building before they grab > those big brass nozzles to spray a stream of water into a building. > Go figure...) Following you off topic, I know of one admin type who has stated "I don't care what sort of fine the power company wants to give me, if my property's on fire, I'm going to pull the meter, in order to hand it to the first responder, rather than have them sit there waiting for the power tech to arrive while my house burns." Back on topic, I like the the idea of a timed escalation. That means there's two things to configure though, timeout(s?) and the set of states to escalate through. I can see different use cases for different sets. Hmmm: pg_ctl -m s:10:f:5:i restart for smart, 5 sec. timeout, escalate to fast, 5 sec., then immediate? Not sure how rhat would interact w/ -t. Perhaps: pg_ctl -t 10 -m s -t 5 -m f -m i restart Some video-processing tools do things like that: the order of options impacts their interaction. Ross -- Ross Reedstrom, Ph.D. reedstrm@rice.edu Systems Engineer & Admin, Research Scientist phone: 713-348-6166 Connexions http://cnx.org fax: 713-348-3665 Rice University MS-375, Houston, TX 77005 GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E F888 D3AE 810E 88F0 BEDE