Skip to main content
Version: V1.0.0

UUID_SHORT

Syntax

UUID_SHORT()

Description

Returns a "short" universal identifier in the form of a 64-bit unsigned integer.

The return value of UUID_SHORT() is guaranteed to be unique if the following conditions are met:

  • The server_id value of the current server is between 0 and 255 and is unique among the source and replica servers. If the total number of server_id values exceeds 256, the generated "short" universal identifier cannot be guaranteed to be unique in space, although this function will not return an error.

  • Do not set the system time of the server host during seekdb restart.

  • During seekdb restart, the average number of calls to UUID_SHORT() per second is less than 16 million.

The return value of UUID_SHORT() is constructed as follows:

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

Examples

SELECT UUID_SHORT();
+-----------------------+
| UUID_SHORT() |
+-----------------------+
| 92395783831158784 |
+-----------------------+
1 row in set (0.001 sec)