Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh yeah, that makes sense. At least for CHAR(36), but I'm not sure how VARCHAR(36) as given in the article would behave. (Never mind I just looked it up and it depends on the storage engine - e.g. MEMORY will always allocate the max size.)


You'd be insane to put the primary key in a varchar. Mysql is much faster with static width tables. Your main user table should be static width for all the fields.


As opposed to the insanity of storing UUIDs as strings at all? Once you start going into the rabbit hole, you better be prepared to go all the way down.


No doubt. You can store them as INTs! Tho it does get a little hairy dealing with the conversion with MySQL.


Is this true for all storage engines?


It is not true for innodb (default). See my other comments in this thread.


Storage, and index are different. You expand the UTF8 chars into bytes that are then part of a binary tree. It actually gets more interesting when you consider the collations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: