Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CEEFF9FB5CB for ; Tue, 10 Apr 2007 13:55:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 39424-03 for ; Tue, 10 Apr 2007 13:55:33 -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 69F499FA36D for ; Tue, 10 Apr 2007 13:55:34 -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 1HbJcv-0002ZJ-Dg for pgsql-sql@postgresql.org; Tue, 10 Apr 2007 12:55:29 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id E088C3FAF; Tue, 10 Apr 2007 12:55:23 -0400 (EDT) Date: Tue, 10 Apr 2007 12:55:23 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: A long-running transaction Message-ID: <20070410165523.GB20033@phlogiston.dyndns.org> References: <461261AD.6060108@herakles.homelinux.org> <20070403201420.GB1519@phlogiston.dyndns.org> <461BBE33.9030807@herakles.homelinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <461BBE33.9030807@herakles.homelinux.org> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/111 X-Sequence-Number: 28111 On Wed, Apr 11, 2007 at 12:41:23AM +0800, John Summerfield wrote: > The Linux kernel's clearly doing a lot of work, and the disk supports You might also be into context-switch hell. What processor, which kernel, and which Postgres version again? > >>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. > > It should be in cache: it's all one transaction, and on the laptop, It's not in cache if you're updating -- you have to write it. > there's over a Gbyte of RAM. Indeed, I would expect postgresql itself to > cache it (except the fact it uses so little RAM suggests it doesn't do > that at all). What do you have configured as your shared buffers? If you haven't given very much, there won't be much in the way of buffers used, of course. Note that there's a much earlier diminishing return on the size of shared buffers in Postgres than in many systems. A -- Andrew Sullivan | ajs@crankycanuck.ca The whole tendency of modern prose is away from concreteness. --George Orwell