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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com