简体   繁体   中英

Row key in Cassandra

Before I`ve found good explanation of keys in Cassandra:

Difference between partition key, composite key and clustering key in Cassandra? .

Now I am reading about partitioner and there I can see term "row key". What is the row key? How can I list it with CQL?

The row key is just another name for the PRIMARY KEY. It is the combination of all the partition and clustering fields, and it will map to just one row of data in a table. So when you do a read or write to a particular row key, it will access just one row.

In terms of the partitioner, that only uses the partition key fields, and it generates a token hash value that determines which node in a cluster the partition will be stored on. Individual rows are stored within partitions, so if there are no clustering columns, then the partition will hold a single row and the row key would be the same as the partition key.

If you have clustering columns, then you can store multiple rows within a partition and the row key will be the partition key plus the clustering key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM