Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1F3A9B5D832 for ; Thu, 26 May 2011 16:50:22 -0300 (ADT) 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 27787-06 for ; Thu, 26 May 2011 19:50:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6B718B5DBF7 for ; Thu, 26 May 2011 16:50:13 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Thu, 26 May 2011 14:50:12 -0500 Message-Id: <4DDE689C020000250003DDA0@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Thu, 26 May 2011 14:50:04 -0500 From: "Kevin Grittner" To: "Mario Splivalo" , Subject: Re: COMMIT takes long time for read only transaction References: <4DDE99B1.6010402@megafon.hr> In-Reply-To: <4DDE99B1.6010402@megafon.hr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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: 201105/171 X-Sequence-Number: 37608 Mario Splivalo wrote: > 2011-05-26 18:25:51.624 CEST [16163] > [192.168.1.5(32431)] > COMMIT LOG: duration: 11159.202 ms statement: COMMIT > 2011-05-26 18:26:05.788 CEST [16163] > [192.168.1.5(32431)] > COMMIT LOG: duration: 326.856 ms statement: COMMIT > > This is a grep from a postgres log when I had logging of all > statements enabled. I did grep by the local pid (16163), and what > I don't understand is: > - why is first COMMIT taking 11 seconds, when there are only > SELECTs in the transaction? SELECTS don't call any user defined > functions, just plain reads from the tables. > - what is that second COMMIT? If I issue COMMIT without 'BEGIN' > shouldn't I get: "COMMIT WARNING: there is no transaction in > progress" Hard to say what's going on without knowing more about your logging configuration. If you run this query and post the results it will help clarify the situation: http://wiki.postgresql.org/wiki/Server_Configuration -Kevin