Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Surrogate Keys: an Implementation Issue

Re: Surrogate Keys: an Implementation Issue

From: Keith H Duggar <duggar_at_alum.mit.edu>
Date: 28 Jul 2006 00:21:36 -0700
Message-ID: <1154071296.514618.198050@p79g2000cwp.googlegroups.com>


Brian Selzer wrote:
> Current: Jane Jones Married Proposed: Jane Smith Divorced
>
> Do Jane Jones and Jane Smith represent different people?
> Or did Jane Jones get Divorced? Because the only key is
> mutable, there isn't enough information to answer that.
> Another problem involves temporal constraints. Consider
> the following states for the people table and a transition
> constraint, Single people can't become Divorced:
>
> Current: Jane Jones Married Proposed: Jane Jones Married
> Current: Jane Smith Single Proposed: Jane Smith Divorced
>
> Should the proposed state be rejected? Or is it possible
> that Jane Jones got Divorced becoming Jane Smith and Jane
> Smith married Bob Jones? Because the only key is mutable
> and because there or no row-based operations, there isn't
> enough information to answer that. The lack of row-based
> operations means that if all keys are mutable, it is not
> possible to enforce transition constraints because there
> is no way to correlate the rows in the Current state with
> those in the Proposed state. Another problem involves the
> situation I described above. Add the following states for
> a children table:
>
> Read: Jane Jones Brian Write: Jane Jones Beth
> Read: Jane Jones Lynn Write: Jane Smith Brian
> Write: Jane Smith Lynn
>
> When Bob reads Jane Jones' row from the people table, Jane
> Jones has two children, Brian and Lynn, but when Bob is
> ready to update the people table, Jane Jones only has one
> child, Beth. Clearly these are two different people, even
> though the row in the people table is identical. Because
> the only key is mutable, Bob will be updating the wrong
> row.
>
> It should be obvious that surrogates solve these problems.

I know this is asking a lot; but, would someone please address the examples/arguments Brian gave above? As a newb trying to learn RM principles the above examples seem interesting and I would appreciate learning how to properly handle them.

Also, can someone confirm whether I have properly understood one of BBs comments

Bob Badour wrote:
> In the final case above, if something changes that does
> not affect the truth of the assertion, it is an
> unimportant change that we can ignore. If something
> changes that does affect the truth of the assertion, the
> integrity function should detect that the assertion was
> not derivable given the new information.

Does this mean, for example, that if I selected a tuple (K0,A0...AN) say with key value K0, went on vacation during which time K0 was modified (name change for example) to K1, returned from vacation and modified some subset of (A0...AN) to (A0...AN') and then submitted the assertion (K0,A0...AN) -> (K0,A0...AN') that the integrity function would signal some error? Something like "Error no tuple (K0,A0...AN)" exists? To recover from this error would I need to discover K1 and confirm that (K1,A0...AN) -> (K1,A0...AN') remains (after my vacation) an assertion that I wish to make? What is this "discovery" process called?

Thank you,

Received on Fri Jul 28 2006 - 02:21:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US