SpongeBob
SpongeBob

Reputation: 464

Cassandra IN clause for non primary key column

I want to use the IN clause for the non-primary key column in Cassandra. Is it possible? if it is not is there any alternate or suggestion?

Upvotes: 0

Views: 557

Answers (1)

Three possible solutions

  • Create a secondary index. This is not recommended due to performance problems.
  • See if you can designate that column in the existing table as part of the primary key
  • Create another denormalised table that table is optimised for your query. i.e data model by query pattern

Update:

And also even after you move that to primary key, operations with IN clause can be further optimised. I found this cassandra lookup by list of primary keys in java very useful

Upvotes: 1

Related Questions