Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 85F1BDE314D for ; Tue, 3 Apr 2012 13:42:06 -0300 (ADT) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SF6ny-0003f2-Oh for pgsql-bugs@postgresql.org; Tue, 03 Apr 2012 16:42:05 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 03 Apr 2012 11:41:48 -0500 Message-Id: <4F7AE1F20200002500046B1C@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Tue, 03 Apr 2012 11:41:38 -0500 From: "Kevin Grittner" To: "Heikki Linnakangas" , "Alex Matzinger" Cc: Subject: Re: BUG #6571: Postgres Kills 'Select 1' query randomly on hot standby databases References: <4F7A9D87.9060708@enterprisedb.com> <4F7B2050.9000507@experts-exchange.com> In-Reply-To: <4F7B2050.9000507@experts-exchange.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201204/12 X-Sequence-Number: 32763 Alex Matzinger wrote: > The connection that is executing the SELECT 1 are generally open > for 1-5 hours before they are killed. The specific connection > only executes SELECT 1. The transaction is simply BEGIN, and then > SELECT 1's, no other query is executed. Don't do that. In particular, never put more into a single database transaction than is required for integrity; and there is no apparent reason why running a series of "SELECT 1" statements needs to be in a single transaction. (It's not blindingly obvious why you would want to do it in general, but I can imagine it possibly being useful for monitoring purposes.) -Kevin