Datraverse
Technical resources    · Home · Contact

· Apache
· C/C++
· DHTML
· Java
· Linux
· MySQL
· PDF
· Perl
· PHP
· Databases
· Tools
· Win32
· XML

OpenResume

Write your resume in XML and generate HTML, PDF and RTF documents. more...


home of Vim editor
 
  
  SQL

Composite vs. Surrogate keys

"The choice of keys is at the logical level and, therefore, should not be contaminated by performance considerations, which are at the physical level -- that's data independence. You keep the two levels separate by chosing keys based on logical, not physical criteria. If then you get bad performance, the problem is with the DBMS, not with your choice of keys. You may have then to bastardize your design, but then you should expect problems. The real solution should come from the DBMS vendor.

I wouldn't call it law, but a principle or guideline -- stability -- you should not select keys that change in the first place. Then you do not need surrogate keys to ensure stability.

In general, if you cannot find an obvious natural key, reconsider your design -- chances are there's something wrong with it. And if the natural key is composite, it's a good idea -- although not a universal law -- to add a simple surrogate key."

Author: Fabian Pascal at Database Debunking

Database Debunking

The web site that sets matters straight by dispelling fallacies, misinformation and confusion about database management. The forum for concepts, principles and methods and their practical implications that receive little, incorrect, or no coverage from the trade media and no consideration from vendors and industry pundits.



  
Forums
· DB Debunkings
 
Apache Server
        Software MySQL Database Engine PHP Scripting Language
Send mail to webmaster@datraverse.nl
with questions or remarks about this website.
Copyright 1998-2005 Datraverse B.V.