Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 8E5822E351F for ; Sun, 16 Dec 2007 16:45:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 07237-08 for ; Sun, 16 Dec 2007 16:45:05 -0400 (AST) Received: from pillette.com (adsl-67-119-5-202.dsl.snfc21.pacbell.net [67.119.5.202]) by postgresql.org (Postfix) with ESMTP id 0DFB82E351D for ; Sun, 16 Dec 2007 16:45:06 -0400 (AST) Received: (from andrew@localhost) by pillette.com (8.11.6/8.11.6) id lBGKj2I03112; Sun, 16 Dec 2007 12:45:02 -0800 Date: Sun, 16 Dec 2007 12:45:02 -0800 From: andrew@pillette.com Message-Id: <200712162045.lBGKj2I03112@pillette.com> Subject: Re: update 600000 rows To: "Merlin Moncure" Cc: andrew@pillette.com, okparanoid@free.fr, pgsql-performance@postgresql.org X-Originating-IP: 71.135.44.168 X-Mailer: Webmin 0.940 MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.109 tagged_above=0 required=5 tests=AWL=-0.476, BAYES_40=-0.185, FH_HOST_EQ_PACBELL_D=1.67, RDNS_DYNAMIC=0.1 X-Spam-Level: * Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Archive-Number: 200712/251 X-Sequence-Number: 28067 I wrote > That's what I did at first, but later I found better performance with > a TRIGGER on the permanent table that deletes the target of an UPDATE, > if any, before the UPDATE. [INSERT!] That's what PG does anyway, and now I can do > the entire UPDATE [INSERT] in one command. It's probably obvious, but what I should have said is that now I do the INSERT in one command; I have no need of an UPDATE. So I do no UPDATEs, only INSERTs.