Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8C3F0B5DC05 for ; Fri, 24 Jun 2011 09:40:05 -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 35522-05 for ; Fri, 24 Jun 2011 12:39:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from server515.appriver.com (server515l.exghost.com [72.32.253.101]) by mail.postgresql.org (Postfix) with ESMTP id 49DDBB5DC01 for ; Fri, 24 Jun 2011 09:39:59 -0300 (ADT) X-Note-AR-ScanTimeLocal: 6/24/2011 7:39:58 AM X-Policy: GLOBAL - riskcontrollimited.com X-Policy: GLOBAL - riskcontrollimited.com X-Primary: harry.mantheakis@riskcontrollimited.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: @riskcontrollimited.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: PRIVATE->PRIVATE->UNITED STATES->UNITED STATES X-Note-Sending-IP: 72.32.49.5 X-Note-Reverse-DNS: X-Note-WHTLIST: harry.mantheakis@riskcontrollimited.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G200 G201 G202 G203 G207 G208 G219 G309 X-Note: Encrypt Rule Hits: X-Note: Mail Class: ALLOWEDSENDER X-Note: Headers Injected Received: from [72.32.49.5] (HELO FE1.exchange.rackspace.com) by server515.appriver.com (CommuniGate Pro SMTP 5.4.1c) with ESMTP id 151402325; Fri, 24 Jun 2011 07:39:58 -0500 Received: from FE11.exchange.rackspace.com ([192.168.1.63]) by FE1.exchange.rackspace.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 24 Jun 2011 07:39:15 -0500 Received: from [192.168.20.134] ([87.194.70.108]) by FE11.exchange.rackspace.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 24 Jun 2011 07:39:14 -0500 Message-ID: <4E048574.6010706@riskcontrollimited.com> Date: Fri, 24 Jun 2011 13:39:16 +0100 From: Harry Mantheakis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Claudio Freire CC: pgsql-performance@postgresql.org Subject: Re: Long Running Update References: <4E035649.20007@riskcontrollimited.com> <4E0472AB.9090507@riskcontrollimited.com> In-Reply-To: X-TagToolbar-Keys: D20110624133916557 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Jun 2011 12:39:14.0711 (UTC) FILETIME=[B9CE8270:01CC326B] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201106/226 X-Sequence-Number: 44159 Thanks again Claudio. It does not look like its locked/blocked - but your hint about doing this task in smaller batches is a good one, and it would be easy enough to organise. I am going to let this task run over the week-end, and then decide. Either way, I shall update this thread. Much obliged! Harry Mantheakis London, UK On 24/06/2011 12:39, Claudio Freire wrote: > On Fri, Jun 24, 2011 at 1:19 PM, Harry Mantheakis > wrote: >>> there are lots of ways in which it could be struggling... >> I have been monitoring the server with IOSTAT -d and IOSTAT -c and I cannot >> see anything alarming. > If iostat doesn't show disk load, either iostat doesn't work well > (which could be the case, I've found a few broken installations here > and there), or, perhaps, your update is waiting on some other update. > > I've seen cases when there are application-level deadlocks (ie, > deadlocks, but that the database alone cannot detect, and then your > queries stall like that. It happens quite frequently if you try such a > massive update on a loaded production server. In those cases, the > technique someone mentioned (updating in smaller batches) usually > works nicely. > > You should be able to see if it's locked waiting for something with > "select * from pg_stat_activity".