Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 20D539FA47A for ; Tue, 7 Aug 2007 15:00:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 32320-05 for ; Tue, 7 Aug 2007 14:59:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 916169FB580 for ; Tue, 7 Aug 2007 14:59:19 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id BE530564AF; Tue, 7 Aug 2007 12:59:18 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 7 Aug 2007 12:59:14 -0500 Date: Tue, 7 Aug 2007 12:59:14 -0500 From: Decibel! To: Richard Huxton Cc: Mark Makarowsky , pgsql-performance@postgresql.org Subject: Re: Update table performance Message-ID: <20070807175913.GH25704@nasby.net> References: <435532.80672.qm@web32210.mail.mud.yahoo.com> <46B8749F.8010002@archonet.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jmRPoIC9n3oXxCzZ" Content-Disposition: inline In-Reply-To: <46B8749F.8010002@archonet.com> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:070807:dev@archonet.com::wLHN8nF41GeMOXQ8:01OLb X-Hashcash: 1:20:070807:bedrockconstruction@yahoo.com::mTLbfn6bW0F5xRd3:00000000 0000000000000000000000004Xe8 X-Hashcash: 1:20:070807:pgsql-performance@postgresql.org::u6SlNQGv2cHvjysw:00000 000000000000000000000000HbAI X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/60 X-Sequence-Number: 26190 --jmRPoIC9n3oXxCzZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 07, 2007 at 02:33:19PM +0100, Richard Huxton wrote: > Mark Makarowsky wrote: > >I have a table with 4,889,820 records in it. The > >table also has 47 fields. I'm having problems with > >update performance. Just as a test, I issued the > >following update: > > > >update valley set test=3D'this is a test' > > > >This took 905641 ms. Isn't that kind of slow? >=20 > The limiting factor here will be how fast you can write to your disk.=20 Well, very possibly how fast you can read, too. Using your assumption of 1k per row, 5M rows means 5G of data, which might well not fit in memory. And if the entire table's been updated just once before, even with vacuuming you're now at 10G of data. --=20 Decibel!, aka Jim Nasby decibel@decibel.org EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) --jmRPoIC9n3oXxCzZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGuLLxdO30qud8SkgRApoaAJ9md35Xk8yLiJW0AgxIseeYS3YztQCghy+L NZ1idIvBZrUML6924lMkEK8= =g2zk -----END PGP SIGNATURE----- --jmRPoIC9n3oXxCzZ--