I wrote a CMS 5 years ago, which completely relies on GUID's (generated by cf's createUUID(), every imaginable object in the cms is referenced with a uuid, so quite a lot get created. I use it quite heavily for 5 years now, and a bunch of friends also installed it and used it, and up til now we didn't get any duplicate uuid, including cross-server check (and honestly, i think i wont get any as long as i'll use it). Of course i'm not generating billions of numbers in a CMS, but at least this gives you a real-life example.
On performance level, i can give you a real-life axample where we played with using both on a system containing aprox. 1.500.000 records with relations in 10 tables on a tuned oracle, the average query execution time was aprox twice as high for GUID's compared to INT's. We went for the INT's. Cheers. On Wed, 8 Dec 2004, Steve Runyon wrote: > I know we're supposed to code to handle exceptions like that, but > that's so unlikely for GUIDs that (IMHO) you're more likely to mistype > something and cause an error than your error-prevention code is to > prevent an error that would otherwise have occurred. Of course, I > could be totally wrong! :) Has anybody here ever seen a duplicate > GUID? > > > Somebody in a previous email mentioned getting the values of the > just-inserted keys. Here are some tricks: > > * In SQL Server, use scope_identity() after inserting the row to get > the value of the identity that was just inserted. You can do it in a > cfquery like this: > <cfquery name="blah" datasource="blahdsn"> > declare @IntPK int > > insert into MyIdentityTable ( ... ) > values ( ... ) > > set @IntPK = scope_identity() > select @IntPK as NewIntPK > </cfquery> > Don't use @@identity or ident_current() - you might not get what you expect. > * Do something similar to get a GUID PK. > <cfquery name="blah" datasource="blahdsn"> > declare @GuidPK uniqueidentifier > set @GuidPK = newid() > > insert into MyGuidTable( GuidPK, ... ) > values ( @GuidPK, ... ) > > select @GuidPK as NewGuidPK > </cfquery> > * In Oracle, do it like the GUID in SQL, but use the sequence instead > of newid(). > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at > [EMAIL PROTECTED] > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at [EMAIL PROTECTED]
