We want to use cassandra to store complex data
but we can't figure out how to organize indexes.
Our table (column family) looks like this:
Users =
{
RandomId int,
Firstname varchar,
Lastname varchar,
Age int,
Country int,
ChildCount int
}
We have queries with mandatory fields (Firstname, Lastname, Age) and extra search options (Country, ChildCount).
How should we organize the index to make this kind of queries faster?
First I thought, it would be natural to make composite index on (Firstname, Lastname, Age) and add separate secondary index on remaining fields (Country and ChildCount).
But I can't insert rows into table after creating secondary indexes and I can't query the table.
Using
- cassandra 1.1.0
- cqlsh with --cql3 option.
Any other suggestions to solve our problem (complex queries with mandatory and additional options) are welcome.