My data model looks like this way
#keyspace_name{
#columnfamily1
{startDate_mobileNo: // row key
{ Call_TYpe: // super column
{ xyz: value
endDate : value;
}
}
}
Now i want to make search result filtering the startDate_mobileNo, Call_TYpe and endDate. This can be done by making endDate as a secondary index. But secondary indexing in a super column is not possible. So i am unable to figure how to proceed. Yes, i can do the secondary indexing filtering part by filtering result data using simple java coding. But i guess this is not the right idea as in case large data there may be scarcity of memory. So please suggest me some ideas.
Thanks In Advance
I believe you can get what you want using composite keys, which have new first-class CQL support in Cassandra 1.1. See this blog post about modeling with composites for some more information.
Supercolumns are definitely the wrong way to go- they have always been somewhat problematic, and are now deprecated, and you can get everything you wanted from them using composites instead.
If I'm interpreting your model right, you might do something like:
CREATE TABLE columnfamily1 (
startDate timestamp,
mobileNo text,
Call_TYpe int,
endDate timestamp,
xyz text,
PRIMARY KEY (startDate, mobileNo, Call_TYpe)
);
You could also make a secondary index on endDate if you wanted. It's not clear to me whether you would.
If you would like to give a more concrete example of the sorts queries you need to support, I may be able to help more.