Comments - GUID/UUID Performance
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
So what is the solution for Java/PHP v4-based UUID's
Maybe I am missing something obvious here - or being too simplistic.
But if you're working with a single DB server, and code running on that DB server is the one which allocates the UUID, couldn't the MAC part also be shuffled to the front to also improve clustering?
Actually, in our case we have a small number of server nodes feeding a DB, but each are unique, and clustering tends to only be an issue when exporting from a single server, which ends up being similar
I guess my concern is does this threaten the uniqueness of the UUID?
In the code example isn't there a separator between the create statement of the functions missing ? ()
DELIMITER // CREATE FUNCTION UuidToBin(_uuid BINARY(36)) RETURNS BINARY(16) LANGUAGE SQL DETERMINISTIC CONTAINS SQL SQL SECURITY INVOKER RETURN UNHEX(CONCAT( SUBSTR(_uuid, 15, 4), SUBSTR(_uuid, 10, 4), SUBSTR(_uuid, 1, 8), SUBSTR(_uuid, 20, 4), SUBSTR(_uuid, 25) )); // CREATE FUNCTION UuidFromBin(_bin BINARY(16)) RETURNS BINARY(36) LANGUAGE SQL DETERMINISTIC CONTAINS SQL SQL SECURITY INVOKER RETURN LCASE(CONCAT_WS('-', HEX(SUBSTR(_bin, 5, 4)), HEX(SUBSTR(_bin, 3, 2)), HEX(SUBSTR(_bin, 1, 2)), HEX(SUBSTR(_bin, 9, 2)), HEX(SUBSTR(_bin, 11)) )); // DELIMITER ;Thanks - fixed in the article.