Re: Avoiding surrogate keys

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: Avoiding surrogate keys
Дата
Msg-id 1271877916.2857.2.camel@jd-desktop.iso-8859-1.charter.com
обсуждение исходный текст
Ответ на Re: Avoiding surrogate keys  (Merlin Moncure <mmoncure@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Avoiding surrogate keys
Следующее
От: Philippe Lang
Дата:
Сообщение: Re: Avoiding surrogate keys