If I use the UUID_SHORT() function in an INSERT statement, how do I make sure the UUID it creates has not already been used in the table before, does it automatically check that, and regenerate a UUID on collision?
A:
The value of UUID_SHORT() is guaranteed to be unique if the following conditions hold:
The server_id of the current host is unique among your set of master and slave servers
server_id is between 0 and 255
You don't set back your system time for your server between mysqld restarts
You do not invoke UUID_SHORT() on average more than 16 million times per second between mysqld restarts
Avitus
2010-05-10 01:59:58
Ok so if I am only using it every few days or more it should always remain unique correct?
Murray
2010-05-10 02:02:54