Re: Newbie question

From: Paul <>
Date: Wed, 22 Jun 2005 20:03:20 +0100
Message-ID: <42b9b5f9$0$2037$>

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
> numbers.

It seems there are two categories of surrogate keys:

  1. keys that leak out into the real world - on invoices, tickets, etc.
  2. 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

Original text of this message