Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id A1F9C2E0065 for ; Tue, 22 Apr 2008 06:48:11 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 41326-05 for ; Tue, 22 Apr 2008 06:48:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from secure.socket.ch (secure.socket.ch [212.103.70.36]) by developer.postgresql.org (Postfix) with ESMTP id 9B8C82E0044 for ; Tue, 22 Apr 2008 06:48:08 -0300 (ADT) Received: from [194.153.94.2] (helo=[192.168.1.39]) by secure.socket.ch with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1JoF6Y-000IPT-4k; Tue, 22 Apr 2008 11:48:04 +0200 Cc: "Chris Browne" , pgsql-performance@postgresql.org Message-Id: <3D0211BE-8936-4705-964F-42E31263D88A@socket.ch> From: Thomas Spreng To: Scott Marlowe In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: Oddly slow queries Date: Tue, 22 Apr 2008 11:48:01 +0200 References: <3D7728ED-3D36-47E6-9266-351073ED4E11@socket.ch> <60y77du7qs.fsf@dba2.int.libertyrms.com> <20B852C4-2ACA-445F-9289-558B6C86BAB4@socket.ch> X-Mailer: Apple Mail (2.919.2) X-SA-Exim-Connect-IP: 194.153.94.2 X-SA-Exim-Mail-From: spreng@socket.ch X-SA-Exim-Scanned: No (on secure.socket.ch); SAEximRunCond expanded to false X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/310 X-Sequence-Number: 29803 On 19.04.2008, at 19:04, Scott Marlowe wrote: >>> No, that will certainly NOT just affect write performance; if the >>> postmaster is busy writing out checkpoints, that will block SELECT >>> queries that are accessing whatever is being checkpointed. >>> >> >> What I meant is if there are no INSERT's or UPDATE's going on it >> shouldn't >> affect SELECT queries, or am I wrong? > > But checkpoints only occur every 10 seconds because of a high insert / > update rate. So, there ARE inserts and updates going on, and a lot of > them, and they are blocking your selects when checkpoint hits. > > While adjusting your background writer might be called for, and might > provide you with some relief, you REALLY need to find out what's > pushing so much data into your db at once that it's causing a > checkpoint storm. that's correct, there are nightly (at least at the moment) processes that insert around 2-3 mio rows and delete about the same amount. I can see that those 'checkpoints are occurring too frequently' messages are only logged during that timeframe. I assume that it's normal that so many INSERT's and DELETE's cause the background writer to choke a little bit. I guess I really need to adjust the processes to INSERT and DELETE rows in a slower pace if I want to do other queries during the same time. cheers, tom