Sequence Vs. GUID
515842Nov 21 2006 — edited Nov 28 2006I'm looking for an opinion or past experiences with using GUID's instead of sequences for generating unique identifiers in a system.
I like the fact that GUID's are unique in a distributed environment so we wouldn't have to worry about syncronizing indexes among environments.
I also like the fact that the app server or the DB or anyone else can generate a GUID and it will be unique.
I've done some benchmark with GUID's and the only thing that concerns me is that index sizes seem to grow quite large, especially for composite indexes. I've used RAW(16) and VARCHAR2(32) as datatypes. RAW was better than VARCHAR2 but still much worse than NUMBER (generated by a sequence).
Queries based on a GUID compound index required about 3 times as many consistent gets.
I worry that GUID's may not scale in a system that depends on a lot of composite indexes for it's queries.
Any comments, past experiences, or opinions will be helpful.
Thanks.