X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id F285DD1B458 for ; Thu, 4 Dec 2003 22:38:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 38598-02 for ; Thu, 4 Dec 2003 18:37:33 -0400 (AST) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id 1E9EDD1B464 for ; Thu, 4 Dec 2003 18:37:31 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1AS26G-0002VJ-0U; Thu, 04 Dec 2003 22:37:32 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 4EE0A16CB0; Thu, 4 Dec 2003 22:37:31 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 7483316732; Thu, 4 Dec 2003 22:37:29 +0000 (GMT) From: Richard Huxton To: William Yu , pgsql-performance@postgresql.org Subject: Re: Slow UPADTE, compared to INSERT Date: Thu, 4 Dec 2003 22:37:28 +0000 User-Agent: KMail/1.5 References: <20031204185751.GA15893@alcaron.ee> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312042237.28378.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/106 X-Sequence-Number: 4966 On Thursday 04 December 2003 19:59, William Yu wrote: > Ivar Zarans wrote: > > I am experiencing strange behaviour, where simple UPDATE of one field is > > very slow, compared to INSERT into table with multiple indexes. I have > > two tables - one with raw data records (about 24000), where one field > > In Postgres and any other DB that uses MVCC (multi-version concurrency), > UPDATES will always be slower than INSERTS. With MVCC, what the DB does > is makes a copy of the record, updates that record and then invalidates > the previous record. [snip] Yes, but he's seeing 0.25secs to update one row - that's something odd. -- Richard Huxton Archonet Ltd