From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | ken(at)scottshill(dot)com |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Column Index vs Record Insert Trade-off? |
Date: | 2006-02-09 10:25:59 |
Message-ID: | 43EB18B7.4060006@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Huxton | 2006-02-09 10:33:06 | Re: unique constraint instead of primary key? what |
Previous Message | A. Kretschmer | 2006-02-09 09:52:56 | Re: Concatenate strings using GROUP BY |