Numbers have better performance.  As an identity field they can be sequential numbers or "every-nth-number" values.
 
GUIDs are hard to guess when someone is hacking a URL or form field.  They are random, for all intents and purposes.  GUIDs take a bit more storage as well, if that is an issue.
 
I like GUIDs because either CF or SQL, or whatever, can generate them before a database insert w/o having to lock a table to find the max value.  This way, you can have a complete "record", including the PK (GUID), before an insert takes place.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Schreck, Tom
Sent: Wednesday, December 08, 2004 7:49 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] GUIDs as Primary/Foreign Keys

What are your thoughts on using GUIDs as primary/foreign keys in tables versus the traditional integers?  How does having GUIDs affect performance for indexing, searching, etc.   

 

Thanks

 

Tom Schreck

Applications Developer

Dresser, Inc.

15455 Dallas Parkway, Suite 1100

Addison, TX  75001-4690

972-361-9943

[EMAIL PROTECTED]

 

 

 

 

<<image001.jpg>>

Reply via email to