I have a UUID string that I want to use as my MySQL tables primary key, the UUID is a 32 character hexadecimal string (after \'-\' characters are stripped). Due to the fact
For most cases it is best to store UUIDs/GUIDs as BINARY(16)
. See these related StackOverflow questions:
The conversion can (and probably should) be done in MySQL instead of PHP so whether you're using a 32bit PHP client or 64bits doesn't matter a bit (pun intended :P)
It depends on storage engine also. TokuDB should handle all these problems.
Use a string type, not an integer. Better is only better if it solves a problem.
If you're really concerned about lookup speed, use a synthetic (auto increment) primary key. You can place a unique constraint on the UUID column, and use it only once to look up the synthetic key which is subsequently used for your joins etc.