Re: Surrogate keys (Was: enums)

From: Leandro Guimarães Faria Corcete DUTRA <leandro(at)dutra(dot)fastmail(dot)fm>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Surrogate keys (Was: enums)
Date: 2006-01-18 13:08:53
Message-ID: loom.20060118T140650-865@post.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim C. Nasby <jnasby <at> pervasive.com> writes:

> a) the optimizer does a really poor job on multi-column index statistics

So it should be fixed?

And there are a *lot* of singular, natural keys.

> b) If each parent record will have many children, the space savings from
> using a surrogate key can be quite large

Not such a common case.

> c) depending on how you view things, putting actual keys all over the
> place is denormalized

How come? Never!

> Generally, I just use surrogate keys for everything unless performance
> dictates something else.

What I am proposing is the reverse: use natural keys for everything unless
performance dictates something else.

In support of my PoV:
http://blogs.ittoolbox.com/database/soup/archives/007327.asp?rss=1

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Leandro Guimarães Faria Corcete DUTRA 2006-01-18 13:11:44 Re: Surrogate keys (Was: enums)
Previous Message Magnus Hagander 2006-01-18 09:51:44 Re: Bad estimate on LIKE matching