On Saturday 17 September 2005 21:40, Dan Nelson wrote: > In the last episode (Sep 17), Christian Parpart said: > > On Saturday 17 September 2005 08:34, Gleb Paharenko wrote: > > > mysql> show create table ui\G; > > > > > > Table: ui > > > Create Table: CREATE TABLE `ui` ( > > > `uuid()` varchar(36) NOT NULL default '' > > > > I've been testing your example as I feel really much safer with UUIDs > > instead of auto_increments, however, my column datatype is > > VARCHAR(12) so 24bytes shorter than a usual UUID, although, all > > uuid() SELECTs differ only in first 12 bytes - why? > > The node-based uuid format that mysql generates has this format: > > time_low "-" time_mid "-" time_high_and_version "-" > clock_seq_and_reserved clock_seq_low "-" node > > Node should be contant as long as you don't switch network cards in the > machine, clock_seq is usually only reset across reboots (or mysql > restarts since mysql currently generates its own uuid even if the OS > provides a uuid generator), and time is a timestamp accurate to 100 > nanoseconds. So assuming a single mysql server that doesn't get > rebooted, you'll only ever see different values in the first three > hyphenated fields. > > See RFC 4122 for more details. http://www.ossp.org/pkg/lib/uuid/ is a > nice uuid library that includes a uuid decoder.
Heya, thanks. didn't know that this is even an RFC :) Thanks for the description. Regards, Christian Parpart.
pgpSUsonoRX6P.pgp
Description: PGP signature