fattah.safa
fattah.safa

Reputation: 966

Cassandra Primary Key with no Clustering Key

I have a table that contains words with their frequencies in Cassandra table(word, frequenc0y, frequency1).
Can I make the primary key consisting of only word as Partition key? if not, can I use word also as Clustering key?

Upvotes: 1

Views: 1070

Answers (1)

xmas79
xmas79

Reputation: 5180

You have no constraints, except that you cannot reuse your columns, so you can put only a single column in your PRIMARY KEY definition, that will specifically be your PARTITION KEY.

BTW, if that's all you need, and depending on your UPDATE capabilities on the frequency0 and frequency1 columns, that could be a job for counter columns. Have a look at the official documentation about counters:

HTH.

Upvotes: 2

Related Questions