8
votes

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?

1

1 Answers

13
votes

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