UUID_SHORT

2023-10-24 09:23:03  Updated

Syntax

UUID_SHORT()

Purpose

You can call this function to return a short universal identifier as a 64-bit unsigned integer.

If the following conditions are met, the value returned by UUID_SHORT() is unique:

  • The server_id of the current server ranges from 0 and 255 and is unique within a group of source and replica servers. If the sum of server_id values is greater than 256, the generated short universal identifier may not be unique in space, although this function does not return an error.

  • Do not set the system time of an OBServer during its restart.

  • During the restart of an OBServer, the UUID_SHORT() function is called less than 16 million times per second on average.

Structure of the value returned by UUID_SHORT():

(server_id & 255) << 56
+ (server_startup_time_in_seconds << 24)
+ incremented_variable++;

Examples

obclient> SELECT UUID_SHORT();
+-----------------------+
          UUID_SHORT() 
+-----------------------+
 92395783831158784 
+-----------------------+
1 row in set

Contact Us