cassandra can you use two secondary indexes at the same time?

On this page:

https://docs.datastax.com/en/cql/3.3/cql/cql_using/useMultIndexes.html

it says at the bottom “The error is not due to multiple indexes, but the lack of a partition key definition in the query.” which is not right, even if you add a partition key to the query, you can’t use two secondary indexes at the same time. Or you can use a secondary index “by itself” (with no primary key specified) but it will hit “all nodes” to search their various indicies, which isn’t as efficient.

Basically, you almost never want to “allow filtering” so…you’re going to want to move those to a clustering column or to their own table.  Maybe there are other options…

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.