Reputation: 173
The below CQL query resulted in an error saying
No indexed columns present in by-columns clause with equals operator
Note that the column age
was already secondary indexed.
select * from employee where age > 25
However I had another secondary indexed column type
. So when I used that...
select * from employee where type='engineer' and age > 25
I seemed to get proper results.
How does this happen?
Upvotes: 8
Views: 3410
Reputation: 732
Cassandra's built-in secondary indexes are more of a hash-style index, as opposed to a B-tree.
As such, at least one equality comparison is required to perform lookups efficiently (any additional column predicates result in late-filtering of the equality matches).
Try the following wiki page for a decent starting point for questions about Cassandra's secondary indexes: http://wiki.apache.org/cassandra/SecondaryIndexes
Upvotes: 13