Re: Column Index vs Record Insert Trade-off? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Column Index vs Record Insert Trade-off?
Date
Msg-id 43EB18B7.4060006@archonet.com
Whole thread Raw
In response to Column Index vs Record Insert Trade-off?  (Ken Hill <ken@scottshill.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Concatenate strings using GROUP BY
Next
From: Richard Huxton
Date:
Subject: Re: unique constraint instead of primary key? what