Comments - GUID/UUID Performance

 
3 years, 1 month ago Vard Lott

So what is the solution for Java/PHP v4-based UUID's

 
4 years, 11 months ago Rob Walker

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?

 
5 years, 5 months ago Markus Schreiber

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 ;
 
5 years, 3 months ago Richard James

Thanks - fixed in the article.

 
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.