Re: ID field as logical address

From: Bernard Peek <bap_at_shrdlu.com>
Date: Mon, 1 Jun 2009 20:10:18 +0100
Message-ID: <LDw5y3laeCJKFw6C_at_shrdlu.com>


In message <MTTUl.27897$c45.17152_at_nlpi065.nbdc.sbc.com>, Brian Selzer <brian_at_selzer-software.com> writes
>
>"Bernard Peek" <bap_at_shrdlu.com> wrote in message
>news:2hlWqCcL++IKFw36_at_shrdlu.com...
>> In message <ImwUl.30133$PH1.14509_at_edtnps82>, paul c
>> <toledobythesea_at_oohay.ac> writes
>>>Walter Mitty wrote:
>>>> "Brian Selzer" <brian_at_selzer-software.com> wrote in message
>>>...
>>>>> {{L:Smith, F:Mary, Stat:Single},
>>>>> {L:Jones, F:Mary, Stat:Married}}
>>>>>
>>>>> and is then assigned the value,
>>>>>
>>>>> {{L:Smith, F:Mary, Stat:Divorced},
>>>>> {L:Jones, F:Mary, Stat:Married}}
>>>>> ...
>>>...
>>>>> Note that the introduction of an autogenerated ID eliminates all
>>>>> confusion:
>>>>> ...
>>>
>>>"autogenerated ID eliminates all confusion", what a laugh, almost sounds
>>>like a sleeping pill slogan.
>>
>> I think I'd say that an autogenerated ID hides the problem, or at least
>> moves it around. Instead of asserting that the key always refers to an
>> instance within the universe of discourse, you substitute an autonumber
>> field and make the same assertion.
>
>Not so: addition is not the same as substitution.

You misunderstand me. An ID field is added to the table but is substituted in the assertion.

>
>>
>> In an entity the key refers unambiguously to an instance within the
>> universe. When you build a database table that is an aspiration.
>>
>
>Consider an ordered set, such as a deck of cards. When implemented in a
>relation schema, {Position, Card}, there are two candidate keys,
>{Position}, and {Card}. Now suppose that the deck is shuffled, and a
>database update issued to reflect the new state of the deck. The card at
>the bottom of the deck before shuffling may not be the card at the bottom of
>the deck after shuffling. So despite the fact that Position is a candidate
>key of the representative relation schema, instances of it do not
>permanently identify things in the Universe.

Within a single deck of cards at any point either {Position} or {Card} are keys. Within that universe of discourse either would be valid. But if you open this out to include the result of shuffling the deck then you also need to consider {Time}. Having done that you find that a compound key of {Time}{Position} or {Time}{Card} permanently identifies a thing in the universe.

You could take this a step further and expand the universe of discourse to include every state of every deck at every time. In which case you need to stipulate which deck of cards you are referring to as well as the time that you take your readings. I could make this arbitrarily complex by insisting that the model also covers Tarot cards and decks which are in the state of being shuffled.

In many cases a database may not store all of the information required to for a key, and this is the norm when databases hold data about people. Nobody has yet come up with a practical key which uniquely identifies people. I think the closest that anyone has come is my suggestion in this newsgroup; Latitude, Longitude, Altitude and Time of birth.

-- 
Bernard Peek
Received on Mon Jun 01 2009 - 21:10:18 CEST

Original text of this message