LOL! Whoa guys, I am the merest of mere mortals. And today’s PC’s are handling some ginormous amounts of data, so saving data and processing is always a good idea IMNSHO.
Tim - A Unique constraint can and often does involve significant database activity. In Norman’s example, we avoid that by choosing not to run parallel systems. That allows a simple and easy cross reference. And we don’t wind up with a mess like Norman experienced. I bet if Norman were to magically go back into time and do the same project all over again, he would do things differently. We learn. (grin)
Guys- this argument between synthetic and natural keys has been going on forever, since databases started. C. J. Date argued it I believe. COBOL programmers argue about it even. The best advice I would give you or anyone is - do not make a religion of either choice, use the right choice for the each situation. Natural keys are best in some situations. Synthetic keys in others.
Paul L. is obviously concerned with the stability of (primary) keys. Well, fact is, keys are going to change regardless of what design you use. One had best build change control into the design from the very beginning. Controlling change to primary keys is not any more difficult than controlling change to a secondary index. It is definitely one factor to consider when choosing what type of primary key to use.
Natural data, which is real data with meaning, is very often a very good choice. And just like synthetic keys (maybe called surrogate keys these days, depends upon whom you talk to…) they have good sides and bad sides.
I reacted to the absolute authoritarian views expressed - because there is no commandment to use synthetic keys in all cases. or even in most cases. it all depends upon the design. In fact, it quite probably wrong to use synthetic primary keys in all cases. I certainly think so.
Mere mortals experience the same issues as anyone else. If you code an application that makes it possible or easy for people to go in and change things up, they will. Like the fellow around here using the Access database where his client wanted to be able to change the data easily. That would be something I would run away from.
And inevitably, unrestricted and uncontrolled change access to data will screw things up. So, if you possibly can, do not allow it happen.
Same idea applies, though a little less strictly, to ad-hoc reporting. Have you designed a system with ad-hoc reporting only to have some yahoo design a report that gives erroneous or misleading results? Boy Howdy - I sure have, despite taking great care to make it “impossible.”
-Paul