pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Column Index vs Record Insert Trade-off?
2+ messages / 2 participants
[nested] [flat]

* Column Index vs Record Insert Trade-off?
@ 2006-02-09 01:53  Ken Hill <ken@scottshill.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Ken Hill @ 2006-02-09 01:53 UTC (permalink / raw)
  To: pgsql-sql

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?

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Column Index vs Record Insert Trade-off?
@ 2006-02-09 10:25  Richard Huxton <dev@archonet.com>
  parent: Ken Hill <ken@scottshill.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Huxton @ 2006-02-09 10:25 UTC (permalink / raw)
  To: ken@scottshill.com; +Cc: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-02-09 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-02-09 01:53 Column Index vs Record Insert Trade-off? Ken Hill <ken@scottshill.com>
2006-02-09 10:25 ` Richard Huxton <dev@archonet.com>

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