Surrogate key
|
A surrogate key is a unique primary key generated by the RDBMS that is not derived from any data in the database and whose only significance is to act as the primary key.
A surrogate key is frequently a sequential number (e.g., a Sybase "identity column") but doesn't have to be. Having the key independent of all other columns insulates the database relationships from changes in data values or database design (making your database more agile) and guarantees uniqueness.
Some database designers use surrogate keys religiously regardless of the suitability of other candidate keys. However, other database designers will use a key already present in the data, if there is one: the addition of a surrogate key will slow down access to the table, particularly if it is indexed.
"Surrogate key" may also be known as "System-generated key", "Database Sequence number", or an "Arbitrary, unique identifier".
Some other options for surrogate keys are:
- Universally Unique Identifiers (UUIDs)
- Globally Unique Identifiers (GUIs)
See also: Intelligent key
- This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.