pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: ken@scottshill.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Column Index vs Record Insert Trade-off?
Date: Thu, 09 Feb 2006 10:25:59 +0000
Message-ID: <43EB18B7.4060006@archonet.com> (raw)
In-Reply-To: <1139450040.15713.3.camel@localhost.localdomain>
References: <1139450040.15713.3.camel@localhost.localdomain>

Ken Hill wrote:
> Is there a performance trade-off between column indexes and record
> inserts?
> 
> I know that in MS Access there is such a trade-off. This being indexes
> make SQL queries perform faster at the cost of record insert speed. Put
> another way, the more column indexes in a table, the slower a record
> insert in that table performs.
> 
> Is there a similar trade-off in PostgreSQL?

The tradeoff is made in every system. The more indexes you have on a 
table, the more indexes need to be updated when you update/insert/delete 
rows.

So - a unique constraint automatically implies an index in PostgreSQL 
(it's how it implements its unique checks). Other than that, you should 
only index those columns where you will want a small number of rows or 
quick ordering.

-- 
   Richard Huxton
   Archonet Ltd



view thread (2+ messages)

Message-ID: <43EB18B7.4060006@archonet.com>
Permalink:  ../43EB18B7.4060006@archonet.com/
Also on:    postgresql.org/message-id/43EB18B7.4060006@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-sql@postgresql.org
  Cc: dev@archonet.com, ken@scottshill.com
  Subject: Re: Column Index vs Record Insert Trade-off?
  In-Reply-To: <43EB18B7.4060006@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