Re: Surrogate keys (Was: enums)

Поиск
Список
Период
Сортировка
От mark@mark.mielke.cc
Тема Re: Surrogate keys (Was: enums)
Дата
Msg-id 20060119190113.GA7297@mark.mielke.cc
обсуждение исходный текст
Ответ на Re: Surrogate keys (Was: enums)  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: Surrogate keys (Was: enums)  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
On Thu, Jan 19, 2006 at 10:11:51AM -0800, Josh Berkus wrote:
> > So ISTM it's much easier to just use surrogate keys and be
> >done with it. Only deviate when you have a good reason to do so.
> "The lazy man's guide to SQL database design", but Jim Nasby.
> ;-)

Hehe... I was thinking the same thing. I've definately seen cases
where the use of surrogate keys verges on ridiculous. It hasn't
harmed the application, except it terms of complexity. It still works.
It still performs fine. The SQL queries are awful looking. :-)

That's where I would tend to draw the line. For me, I find
implementation and maintenance to be the most expensive part of my
applications. My data hasn't yet become large enough to make disk
space, compute resources, or I/O bandwidth a serious concern.

If I think the use of surrogate keys may make my life harder, I'll try
not to use them. If I think they may make my life easier, I'll use
them without blinking an eye. Harder vs. easier = cost to implement.

Cheers,
mark

-- 
mark@mielke.cc / markm@ncf.ca / markm@nortel.com     __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada
 One ring to rule them all, one ring to find them, one ring to bring them all                      and in the darkness
bindthem...
 
                          http://mark.mielke.cc/



В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Scott
Дата:
Сообщение: Re: No heap lookups on index
Следующее
От: Oleg Bartunov
Дата:
Сообщение: tsearchd (tsearch2 daemon) is available for playing