Re: using UID in DB

From: Date: Wed, 31 Mar 2010 09:43:30 +0000
Subject: Re: using UID in DB
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-303652@lists.php.net to get a copy of this message
On Wed, Mar 31, 2010 at 2:29 AM, Lester Caine <lester@lsces.co.uk> wrote: > Tommy Pham wrote: >>> >>> Storage wise it is just a 128 bit number, so twice as big as a simple 64 >>> bit >>> 'generator' that would normally be used in a single database system. The >>> improvement is to use a raw number rather than a 16 character string. > >> Don't you mean raw number as 16 byte, which is what I intend to use >> binary(16) on MySQL if I'm going to use MySQL as DB, rather than 32/36 >> character string? > > Character is a byte ;) > Firebird we can use character string as 16 bytes. The 'improvement' is to > provide a proper data type for it, and then return a 'UUID' rather than '16 > character string'. > You mean something akin to MSSQL's uniqueidentifier data type - store as 16 byte but will return the hex string on SELECT? AWESOME!! You just gave me another reason not to use MySQL :D

« previous php.general (#303652) next »