Re:Be Careful with UUID or GUID as Primary Keys
by imhoguy on Friday June 09, 2017 @04:07PM
(#14524085)
To take advantage of native UUID support in a database, e.g. PostgreSQL stores them in 128 bits. Also every UUID carries version number so minimal formating needs to be performed to comply with the standard.
[ Parent
| on HN ]
Re:Be Careful with UUID or GUID as Primary Keys
by MichaelGG on Friday June 09, 2017 @04:24PM
(#14524233)
So you're saying Postgres actually wastes cycles verifying the version information and doesn't treat UUID just as a 16 byte opaque structure?
Re:Be Careful with UUID or GUID as Primary Keys
by anarazel on Friday June 09, 2017 @04:50PM
(#14524443)
Well, there's the "input format" (or rather two), which gets parsed into the internal representation. The input format can be either hex text, which allows dashes in some positions, or binary, in which it's just a bytearray. There's no verification otherwise, unless you treat generation of UUIDs, which allows to specify the type, as such.