Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 51F702E0052 for ; Thu, 17 Apr 2008 07:16:17 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19018-05 for ; Thu, 17 Apr 2008 07:16:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by developer.postgresql.org (Postfix) with ESMTP id BD3E12E0044 for ; Thu, 17 Apr 2008 07:16:08 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 2so1529280ywt.73 for ; Thu, 17 Apr 2008 03:16:05 -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=cwFu5dgkIkQZ4srXk75jzMpDW4eODjJZBU59AxQzyzk=; b=kgooddwNSN11rcD93TnNhQO+OOAFoqGqUre8NS2BIYqiHR/0FXByDrX1W0Lu/lfswMvLjOYq/nEtgecYRl5d1Tpr6JUxs65jEDgFL+oF3j9cvSpTb1nJpe9w84/O21T7Pm2MB264zzLM2uZgEYTJzzHtdgG+0bLUyxY26wKvGXA= 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=vMj/JI1ng4NMLgMktUDz9/S/d+y+1Al2A0PQrGusbFUS0QdWEHqziLKXgouWwMz1o4GTomLuOYmhexkKeEIRqFfXONfva/fTyfGE+f1AMpEKCzi50TkE/EWE7/24tM/5Silwfdvu4/KLkfacMHhEbYHnoSTrw3sAwZx4fbF3T8E= Received: by 10.150.228.2 with SMTP id a2mr1408405ybh.59.1208427365161; Thu, 17 Apr 2008 03:16:05 -0700 (PDT) Received: by 10.150.97.21 with HTTP; Thu, 17 Apr 2008 03:16:05 -0700 (PDT) Message-ID: <2e78013d0804170316v2b62d7afy87c3753fb0b55842@mail.gmail.com> Date: Thu, 17 Apr 2008 15:46:05 +0530 From: "Pavan Deolasee" To: "Gunther Mayer" Subject: Re: Exact index overhead Cc: pgsql-performance@postgresql.org In-Reply-To: <48071807.8000409@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48071807.8000409@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/233 X-Sequence-Number: 29726 On Thu, Apr 17, 2008 at 2:57 PM, Gunther Mayer wrote: > > > You see, all updates change most of the data fields but never ever touch > the time field. Assuming correct and efficient behaviour of postgresql it > should then also never touch the time index and incur zero overhead in its > presence, but is this really the case? Normally, whenever a row is updated, Postgres inserts a new index entry in each of the index. So to answer your question, there is certainly index overhead during updates, even if you are not changing the indexed column. But if you are using 8.3 then HOT may help you here, assuming you are not updating any index keys. HOT optimizes the case by *not* inserting a new index entry and also by performing retail vacuuming. The two necessary conditions for HOT are: 1. Update should not change any of the index keys. So if you have two indexes, one on column A and other on column B, update must not be modifying either A or B. 2. The existing block should have enough free space to accommodate the new version A less than 100 fillfactor may help you given your rate of updates. If your application satisfies 1, then I would suggest you to upgrade to 8.3 (if you are not using it already) and then you can create the index without bothering much about overheads. Thanks, Pavan -- Pavan Deolasee EnterpriseDB http://www.enterprisedb.com