1
votes

I have a table with one column here :

User

  • username (Primary key)

In this case column username is primary and partition key.

If I query using SELECT * FROM user it will read data from all partition which break the rule Rule 2: Minimize the Number of Partitions Read from this link http://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling

Is there any way to not break the rule when select all data from table ?

1

1 Answers

1
votes

If you want to get all the users from single partition then you can use extra column as partition key with a constant value. So all your username will reside on same partition. Still, in the above case you will break Rule 1:Spread data evenly around the cluster Even the document says:

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