Any *real* reason to choose a natural, composite PK over a surrogate, simple PK?

Поиск
Список
Период
Сортировка
От dananrg@yahoo.com
Тема Any *real* reason to choose a natural, composite PK over a surrogate, simple PK?
Дата
Msg-id 1149770937.379165.21830@f6g2000cwb.googlegroups.com
обсуждение исходный текст
Ответы Re: Any *real* reason to choose a natural, composite PK over a surrogate, simple PK?  (Trent Shipley <tshipley@deru.com>)
Re: Any *real* reason to choose a natural, composite PK  (Paul M Foster <paulf@quillandmouse.com>)
Список pgsql-general
In the book "Practical Issues in Database Management", Fabian Pascal
notes three reasons for choosing one PK over another - familiarity,
stability, and simplicity.

He notes further that those influenced by OO db design tend to use
simple, surrogate keys for all PKs in all databases they design; that
this is not *precluded* by relational theory, but that there's somehow
something illicit about it.

Today at least, and why I ask, I think it's a good rule of thumb to
create surrogate keys for almost all tables.

"Familiarity" seems like a spurious concern, and a poor tradeoff
against both stability (guaranteeing you are uniquely identifying rows)
and simplicity (with queries, and others intuiting your design).

What am I missing? Why use a composite key *ever* aside from
"familiarity?" Could someone give a real-world example where
"familiarity" is a compelling reason to choose a composite PK, and
trumps stability and simplicity?

Stability seems to be the single-most important factor to consider. If
the database can't uniquely identify a row, what's the point? Choosing
a surrogate key guarantees stability.

Dana


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

Предыдущее
От: tom.darci@gmail.com
Дата:
Сообщение: Re: SessionID, pretty please
Следующее
От: "sergey kapustin"
Дата:
Сообщение: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list