X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 19D19D729B for ; Sun, 21 Aug 2005 17:37:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24581-05 for ; Sun, 21 Aug 2005 20:37:38 +0000 (GMT) Received: from mail28.sea5.speakeasy.net (mail28.sea5.speakeasy.net [69.17.117.30]) by svr1.postgresql.org (Postfix) with ESMTP id 9D6E71FEE071 for ; Sun, 21 Aug 2005 16:05:28 -0300 (ADT) Received: (qmail 5954 invoked from network); 21 Aug 2005 19:05:28 -0000 Received: from dsl081-060-184.sfo1.dsl.speakeasy.net (HELO noodles) ([64.81.60.184]) (envelope-sender ) by mail28.sea5.speakeasy.net (qmail-ldap-1.03) with RC4-MD5 encrypted SMTP for ; 21 Aug 2005 19:05:28 -0000 Subject: Re: (Re)-indexing on updates From: "Jeffrey W. Baker" To: Yves Vindevogel Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Sun, 21 Aug 2005 12:06:05 -0700 Message-Id: <1124651165.5990.1.camel@noodles> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200508/312 X-Sequence-Number: 14059 On Sun, 2005-08-21 at 20:32 +0200, Yves Vindevogel wrote: > > > ______________________________________________________________________ > > Hi, > > Say I have a table with column A, B, C, D > A has a unique index on it (primary key) > B and C have a normal index on it > D has no index > > If I perform a query like update tbl set D = 'whatever' ; > that should make no difference on the indexes on the other columns, > right ? What postgresql does on update is to make a new record, so there will be two records in your table and two records in your index. You would need to vacuum the table to mark the space for the old record free, and you would need to reindex the table to shrink the index. > > Or is there some kind of mechanism that does create a sort of new > record, thus makes the indexes go wild. Yes. -jwb