Re: Guidelines to a decent support of surrogate key implementation

From: Brian Selzer <brian_at_selzer-software.com>
Date: Sat, 26 May 2007 19:22:56 GMT
Message-ID: <jO%5i.2456$5j1.2298_at_newssvr21.news.prodigy.net>


"Brian Selzer" <brian_at_selzer-software.com> wrote in message news:a9Y5i.2427$5j1.2316_at_newssvr21.news.prodigy.net...
>

[snip]

> So, the LINE1 CON could better be stated in this way:
> The meaning represented by a composite key is not invariant with respect
> to time, whereas the meaning represented by a unary key is.
>

For a better illustration of this phenomenon, consider a relation that has two candidate keys, one unary and one binary:

R{A, B, C} | A --> BC and BC --> A

If the unary key is different in different extensions, then it's clear that two objects are being discussed, regardless of the state of the binary key. If the unary key is the same, then it's clear that one object is being discussed, again, regardless of the state of the binary key. For example, here are two extensions at times T1 and T2:

T1: {{A:1, B:2, C:3}}

T2: {{A:1, B:2, C:4}}

So since A is 1 in both T1 and T2, the tuples represent statements about the same object.

Now project away the unary key:

T1: {{B:2, C:3}}

T2: {{B:2, C:4}}

It should be apparent from this example that it cannot be determined whether these tuples represent statements about the same object or about different objects, despite the fact that BC is a candidate key. Consider further:

T1: {{A:1, B:2, C:3}}

T2: {{A:2, B:2, C:3}}

Here, since A is different in T1 and T2, the tuples must represent statements about different objects, but in the projection,

T1: {{B:2, C:3}}

T2: {{B:2, C:3}}

it appears (erroneously) that the tuples represent statements about the same object. This is due to the fallacious assumption that the value of a composite key represents an object in the universe for all time, which as this example shows, is clearly not the case.

If a combination of values *does* represent an object in the universe for all time, then that fact must be explicitly specified by defining a composite or relation-valued domain. A candidate key specification is not sufficient.

[snip] Received on Sat May 26 2007 - 21:22:56 CEST

Original text of this message