Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Surrogate Key vs Production Key
Noons wrote:
> DA Morgan <damorgan_at_x.washington.edu> wrote in message news:<1098930023.768375_at_yasure>...
>
>
>>>>And just like with Cobol and Y2K ... hopefully you'll have >>>>a different job when the duplicates are found and it won't >>>>be your problem. >>> >>>Show me why using surrogate keys stops one from using >>>a unique key where it is needed? >> >>Of course nothing does. And whenever I use surrogate keys I always >>try to protect my data with a unique constraint.
I hopefully never did. I said that to maintain the integrity of the data one must then create additional constraints. Sorry if my original posts were unclear. I often type these missives after a full 10 hour work day followed by 3 hours of lecture.
>>But lets acknowledge we are talking about two more constraints (unique >>and not null) plus one more index. Each with its attendant overhead.
Your examples to me don't qualify as natural keys so I would, based on them agree with you. But if your natural key example had been a driver's license number or an ISBN, or a postal code I would disagree.
>>More not null check constraints if it is the unique index is multicolumn
I am refering to your unique index to maintain data integrity. It will allow NULLs if you don't also add check constraints.
>>and you still have the original issue that if you were to merge your >>data with other data ... the surrogate keys will be duplicated in the >>other system.
John Smith, even by the wildest of imaginations is not a natural key. Try your example again with a real one such as an ISBN or Postal Code.
>>Understand, please, I use surrogate keys daily.
Look more closely. ;-)
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Thu Oct 28 2004 - 19:50:00 CDT