UUIDs and TimeUUIDs
The database distributes data in a cluster based on the partition key. The uuid
(universally unique id) type contains a unique value. Use a uuid
as part of a partition key to uniquely identify a partition in a table. You can use the UUID()
function to create a random uuid
in a CQL statement.
Within a partition, the database orders rows by clustering columns. A timeuuid
is a Type 1 UUID that includes the time of its generation. Order rows by time within a partition by using timeuuid
values in clustering columns. You can use the now()
function to generate a timeuuid
in a CQL statement.
See the literal format for uuid
and timeuuids
in valid literals.