Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sequence instead of composite key - whats better

Status
Not open for further replies.

malva

Technical User
Oct 3, 2001
4
US
Does anyone have any information on the pros and cons on using artificial keys instead of large composite keys. I have been told in Oracle there is no performance hit, but I am not a believer without supporting information.
 
The pros of an artificial key are (1) they can be populated automatically, (2) you don't have to worry about non-unique values (provided you're populating via a sequence, (3) you don't have to worry about NULL values, and (4) foreign keys only have to reference one column instead of multiple columns.
The cons are (1) they impose additional storage requirements.

My personal take - if you have one or more columns that will work as a PK, use them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top