pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Gunther Mayer <gunther.mayer@googlemail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Exact index overhead
Date: Thu, 17 Apr 2008 11:00:14 +0100
Message-ID: <48071FAE.1070408@archonet.com> (raw)
In-Reply-To: <48071807.8000409@gmail.com>
References: <48071807.8000409@gmail.com>

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? If it somehow does update 
> the index too even though the value hasn't changed by some weird 
> implementation detail I'd rather not have that index and live with slow 
> queries for the few times a day that reporting is run.

Well, until 8.3 PG does indeed update the index. That's because with 
MVCC an update is basically a delete+insert, so you'll end up with two 
versions (the V in MVCC) of the row.

With 8.3 there's a new feature called HOT which means updates that don't 
change an index can be more efficient.

So - if you are running 8.3, I'd say try the index and see what 
difference it makes.

-- 
   Richard Huxton
   Archonet Ltd



view thread (6+ messages)  latest in thread

Message-ID: <48071FAE.1070408@archonet.com>
Permalink:  ../48071FAE.1070408@archonet.com/
Also on:    postgresql.org/message-id/48071FAE.1070408@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, gunther.mayer@googlemail.com
  Subject: Re: Exact index overhead
  In-Reply-To: <48071FAE.1070408@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox