Reputation: 4550
I have a Cassandra table where a few columns are defined as the cluster but I need to also be able to filter according to data in the other columns.
So let's say my table consists of the columns A,B,C,D,E,F Columns A,B are the cluster key but I need the "WHERE" part to include values in E or F or E and F so something like SELECT * FROM My_Table WHERE A='x' AND B='y' AND E='t' AND F='g'
Cassandra will only allow this with the ALLOW FILTERING option which of course is not good.
What are my options?
Upvotes: 0
Views: 28
Reputation: 16293
It isn't easy to answer your question since you haven't posted the table schema.
If the columns E and F are not clustering keys, an option for you is to index the columns. However, those have their own pros and cons depending on the data types and/or data you are storing.
For more info, see When to use an index in Cassandra. Cheers!
Upvotes: 2