【发布时间】:2015-10-12 19:07:40
【问题描述】:
我正在查看THIS 并且有一个例子
CREATE TABLE groups (
groupname text,
username text,
email text,
age int,
hash_prefix int,
PRIMARY KEY ((groupname, hash_prefix), username)
)
新列 hash_prefix 包含用户名哈希的前缀。 例如,它可能是哈希模四的第一个字节。 这两列与 groupname 一起构成复合分区 钥匙。它现在分散在一个分区上,而不是一组驻留在一个分区上 跨越四个分区。
first byte of the hash modulo four 是什么意思。考虑到给定的表,你能举一个例子说明排序和分页的查询是什么?
【问题讨论】:
-
我也在关注同一篇文章,迷失在表创建中。我可以知道我们在哪里定义“hash_prefix”值,以便我可以更改模值。
标签: cassandra-2.0 datastax cql3