UUID_SHORT

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

Sintassi

UUID_SHORT()

Spiegazione

Restituisce un universal identifier "breve", un intero senza segno di 64 bit (invece della stringa di 128 bit restituita dalla funzione UUID()).

Il valore di UUID_SHORT() è sicuramente unico, finché sussistono le seguenti condizioni:

  • Il server_id dell'host corrente è univoco nel suo insieme di server master e slave
  • server_id è tra 0 e 255
  • L'ora del server non viene portata indietro tra un riavvio e l'altro di mysqld
  • UUID_SHORT() non viene invocato in media più di 16 milioni di volte al secondo tra un riavvio e l'altro di mysqld

Il valore restituito da UUID_SHORT() è generato in questo modo:

  (server_id & 255) << 56
+ (ora_di_avvio_del_server_in_secondi << 24)
+ contatore++;

Esempi

MariaDB [(none)]> SELECT UUID_SHORT();
+-------------------+
| UUID_SHORT()      |
+-------------------+
| 21517162376069120 |
+-------------------+

Vedi anche

  • UUID() ; Restituisce un Universal Unique Identifier completo (di 128 bit)

Commenti

Sto caricando i commenti......
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.