Re: Avoiding surrogate keys - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: Avoiding surrogate keys
Date
Msg-id 1271877916.2857.2.camel@jd-desktop.iso-8859-1.charter.com
Whole thread Raw
In response to Re: Avoiding surrogate keys  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
On Wed, 2010-04-21 at 15:18 -0400, Merlin Moncure wrote:

> Natural keys:
> *) force formal relationships into your key design (this is good)
> *) Make your database MUCH easier to follow, browse, and understand
> *) in particular cases allow you to skip joins
> *) will make your indexes fatter (this is not good)
> *) can be a pain if your keys are updated frequently
> *) can be a major pain if your key changes in structure (adds a field,
> or changes in type)
>
> Surrogate keys:
> *) Give you faster joins, but more of them (this is a win/loss
> depending on circumstances)

Kind of... natural keys can remove the need for the join in the first
place, which is certainly faster than joining :P

Joshua D. Drake



--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering



pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Avoiding surrogate keys
Next
From: Philippe Lang
Date:
Subject: Re: Avoiding surrogate keys