Re: Newbie question
Date: Wed, 22 Jun 2005 20:03:20 +0100
Alfredo Novoa wrote:
>>>If you want a natural key for a person try >>>the exact latitude, longitude, altitude and precise time of their birth. >> >>That is an excellent example of the need for surrogate keys. :)
> That's why many countries have national document identification
It seems there are two categories of surrogate keys:
- keys that leak out into the real world - on invoices, tickets, etc.
- keys that remain internal to the database. Excuses are that it's often used because of the idea that JOINing on integer columns is faster in practice. Or because some database applications didn't like JOINing on multiple columns (Cognos?). Newbies are fond of this way of doing things.
I think it's this second category of surrogate key that most people object to.
If you're talking to some customer on the phone it's easier to get them to quote a seven-character reference code rather than struggle to take names, dates, addresses etc. with all the spelling complications that go along with it and then try to locate that in the database. (Thinking of very end users here.)
Paul. Received on Wed Jun 22 2005 - 21:03:20 CEST