Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Surrogate keys (Was: enums)


  • From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
  • To: Leandro Guimarães Faria Corcete DUTRA <leandro(at)dutra(dot)fastmail(dot)fm>
  • Cc: pgsql-hackers(at)postgresql(dot)org
  • Subject: Re: Surrogate keys (Was: enums)
  • Date: Sat, 14 Jan 2006 19:28:21 +0900
  • Message-id: <812B6253-520A-46E1-A120-011F23B558D7@myrealbox.com> <text/plain>


On Jan 13, 2006, at 21:42 , Leandro Guimarães Faria Corcete DUTRA wrote:

If you still declare the natural key(s) as UNIQUEs, you have just made
performance worse. Now there are two keys to be checked on UPDATEs and
INSERTs, two indexes to be updated, and probably a SEQUENCE too.

For UPDATEs and INSERTs, the "proper" primary key also needs to be checked, but keys are used for more than just checking uniqueness: they're also often used in JOINs. Joining against a single integer I'd think it quite a different proposition (I'd think faster in terms of performance) than joining against, say, a text column or a composite key.

Michael Glaesemann
grzm myrealbox com






Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group