Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 94AF2650F2F for ; Thu, 26 Jun 2008 13:03:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58708-02 for ; Thu, 26 Jun 2008 13:02:43 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by postgresql.org (Postfix) with ESMTP id AB0F9650E8F for ; Thu, 26 Jun 2008 13:02:33 -0300 (ADT) Received: by yx-out-2324.google.com with SMTP id 8so44322yxb.73 for ; Thu, 26 Jun 2008 09:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=/weCu9FzxjlRf5HkrIHYlZVpTujfezt7SjeJysvRxPI=; b=FkNdQnOsWJfoUGkOUPn7uHAa/LIno2gHQdO7g2ouBlH5Ae26BZFs6h02Q6HBJDRXqP 6BvYkZDVhllt9rIWQwNlqzCQD+p1vRdqnIZ2h7uD96QBPg3asDI4QsLbH3UTj/Tsdg5+ kx+auEyHoV3orhcoTfCUAYwf2f5VedAfMzUfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=d0hYayJu6poAbyx4prKEIOxeIEv87ARBFI7kA2divkd/s0sP2uUawc36d3EzyNaulb zZCJeb5W8swgWqKZpuSu1q+7VyKSVisnUypOF0CDtcyYKmNzkzvNxpelEKDElBWLJ9QG A8DzyDieHv2UcAQGhS8ZiuA7UCrs7qK3Z3gCQ= Received: by 10.114.106.13 with SMTP id e13mr80794wac.157.1214496151749; Thu, 26 Jun 2008 09:02:31 -0700 (PDT) Received: by 10.114.180.17 with HTTP; Thu, 26 Jun 2008 09:02:31 -0700 (PDT) Message-ID: Date: Thu, 26 Jun 2008 10:02:31 -0600 From: "Scott Marlowe" To: "Tom Lane" Subject: =?GB2312?B?UmU6IFtQRVJGT1JNXSC08Li0OiBbUEVSRk9STV0gUG9zdGc=?= =?GB2312?B?cmVzcWwgdXBkYXRlIG9wIGlzIHZlcnkgdmVyeSBzbG93?= Cc: jay , "Heikki Linnakangas" , pgsql-performance@postgresql.org In-Reply-To: <16213.1214492661@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <473587.97248.qm@web32701.mail.mud.yahoo.com> <004b01c8d671$3dec1630$0544000a@hz.ali.com> <486219B6.7050003@enterprisedb.com> <005101c8d773$ff81b2c0$0644000a@hz.ali.com> <16213.1214492661@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/175 X-Sequence-Number: 30525 2008/6/26 Tom Lane : > "jay" writes: >> I know the problem, because there are about 35 million rows , which >> cost about 12G disk space and checkpoint segments use 64, but update >> operation is in one transaction which lead fast fill up the checkpoint >> segments and lead do checkpoints frequently, but checkpoints will cost lots >> resources, so update operation become slowly and slowly and bgwrite won't >> write because it's not commit yet. >> Create a new table maybe a quick solution, but it's not appropriated in some >> cases. >> If we can do commit very 1000 row per round, it may resolve the >> problem. > > No, that's utterly unrelated. Transaction boundaries have nothing to do > with checkpoints. True. But if you update 10000 rows and vacuum you can keep the bloat to something reasonable. On another note, I haven't seen anyone suggest adding the appropriate where clause to keep from updating rows that already match. Cheap compared to updating the whole table even if a large chunk aren't a match. i.e. ... set col=0 where col <>0; That should be the first thing you reach for in this situation, if it can help.