Cassandra `select all from table` 打破数据模型规则

Cassandra `select all from table` break the data model rule

我有一个 table,这里只有一栏:

用户

在这种情况下,列用户名是主键和分区键。

如果我使用 SELECT * FROM user 进行查询,它将从此 link http://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling

从所有违反规则 Rule 2: Minimize the Number of Partitions Read 的分区读取数据

当 select 所有来自 table 的数据时,有没有办法不违反规则?

如果你想从单个分区中获取所有用户,那么你可以使用额外的列作为具有常量值的分区键。所以你所有的用户名都将驻留在同一个分区上。 尽管如此,在上述情况下你会打破 Rule 1:Spread data evenly around the cluster 甚至文件说:

The point is, these two goals often conflict, so you’ll need to try to balance them.