How to index high cardinality column in cassandra

157 views
Skip to first unread message

pava...@way2online.co.in

unread,
Dec 16, 2017, 2:56:13 AM12/16/17
to DataStax Java Driver for Apache Cassandra User Mailing List

I have a column of high cardinality and i need to index that column, because i have to perform range queries on that column.I know that secondary indexes are not fit for high cardinality column in cassandra, so i tried to create materialized view on that table with that column as partition key.But range queries are not working without allow filtering on that view.Always perform allow filtering queries is not a good practice for large amount of data.So suggest me schema for this requirement.


Thanks and Regards
pavs

Andrew Tolbert

unread,
Dec 21, 2017, 10:58:52 AM12/21/17
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Pavs,

Could you please provide some more details about your data and how you are trying to model the table?  I would think that if you effectively create a materialized view, ALLOW FILTERING should not be necessary, but it depends on the criteria of your query.

Thanks,
Andy

Pavani T

unread,
Dec 22, 2017, 12:26:48 AM12/22/17
to java-dri...@lists.datastax.com
Hi Andy,

I posted my schema in following link. https://stackoverflow.com/questions/47843528/how-to-index-high-cardinality-column-in-cassandra?noredirect=1#comment82674652_47843528 .I put the status_id as partition key in the materialized view and tried to perform the range query on that field but it didn't work without allow filtering. Could u please check the schema and suggest the data model.

Thanks and Regards,
pavs

Reply all
Reply to author
Forward
0 new messages