Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Surrogate Key vs Production Key
Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1097210055.635712_at_yasure>...
> Joe Celko weighs in on the side of natural keys and so do I.
>
Joe never had a client walk in and say:
"you know that code of 'A/0001/sdkjskldjklsd-32998'?
Shewt!: we mistyped it.
Can you change it to 'A-0001/sdkjskldjklsd/32998'?
"
and suddenly he realizes that natural key is now duplicated in a 6 level hierarchy of tables as a FK in thousands of rows. Which means a major UPDATE on all those tables with all RI disabled. Count the downtime.
Zero problem with surrogates. I'll take that anytime. For the cost of an extra index. Because I still have to see a natural key that somewhere, somehow, doesn't get mistyped.
Errare humanum est...
To really stuff things up, you need a natural key.
Received on Fri Oct 08 2004 - 07:49:30 CDT
![]() |
![]() |