Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id EEB979FB69D for ; Tue, 3 Apr 2007 17:14:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 03895-08 for ; Tue, 3 Apr 2007 17:14:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id D15449FA594 for ; Tue, 3 Apr 2007 17:14:26 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1HYpOb-0004Ot-Qx for pgsql-sql@postgresql.org; Tue, 03 Apr 2007 16:14:25 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 5EF85404E; Tue, 3 Apr 2007 16:14:20 -0400 (EDT) Date: Tue, 3 Apr 2007 16:14:20 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: A long-running transaction Message-ID: <20070403201420.GB1519@phlogiston.dyndns.org> References: <461261AD.6060108@herakles.homelinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <461261AD.6060108@herakles.homelinux.org> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/43 X-Sequence-Number: 28043 On Tue, Apr 03, 2007 at 10:16:13PM +0800, John Summerfield wrote: > It is hitting the disk pretty hard now on this machine, but the laptop's > still going too, and the disk seems to run about half the time, part of > a second running, part idle (but the intervals are getting shorter). > > It struck me as fairly curious that neither postgresql nor the > application was hogging the CPU. Why? Nothing about this seems likely CPU bound. It's probably I/O. I note is number: > IOwait: 2d 0:46:37.33 28.5% page dea: 16218135 which is pretty awful. Also > For each record, I update a non-key field in another table; the source > data for that other table is less than a megabyte. this is a real issue. Basically, you're constrained at the rotation speed of your disk, because for each record, you have to first find then update one row somewhere else. A -- Andrew Sullivan | ajs@crankycanuck.ca The plural of anecdote is not data. --Roger Brinner