Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GUIDS or Integers for primary keys?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00496066
Message ID:
00496213
Views:
9
>>>What are the Pros and Cons of using GUIDs vs Integers for Primary Keys on a Web based application.
>>
>>In either case, (unless your backend is SQL Server) you have to generate the value. There are some factors that you should consider. If your backend is a native VFP table, the GUID will have to be stored as character and will take up 32 bytes. OTOH, an integer PK takes up only four.
>
>
>Here's an excerpt from a great book, "Creating VFP Apps with Visual FoxExpress" by Bob Archer & Dan Jurden:
>
>*----------------------------------------------------------------------------*
>A GUID is a 128-bit string generated by the operating system. The number is generated with a combination of the network card's MAC address (a unique number assigned to every Ethernet card made) and the current time. The number is said to be unique across space and time, and no two will be duplicated. The GUID is actually stored in hexedecimal form in a 16-bit binary field.

I'm sure that they mean 16 byte, not bit binary field.

The MSDN Library says about GUIDs,

"A UUID, which is given the alias GUID1 in COM and OLE, is a 128-bit (16-byte) integer that is virtually guaranteed to be unique in the world across space and time. Claiming that such an integer is unique across the universe is presumptuous. Global uniqueness is more realistic; hence the G in GUID instead of U. Throughout OLE, GUIDs are used to programmatically identify component classes (in which case they are called class IDs, or CLSIDs) and to identify interfaces (in which case they are called interface IDs, or IIDs)."
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform