For queries with a large number of partition indexes, it is not very efficient.
I think it's better to think about query-based tables that you want to make: you need a table for queries based on the username, and this seems like the right place to store all the information regarding the user. On the other hand, you want to be able to search by country, I suggested providing a list of users: for this you do not need all the information, maybe just the first and last name or just email, etc. Then another table could do this.
This is due to data duplication, but is better suited for Cassandra data modeling ideas.
This will give:
CREATE TABLE users( id UUID, lastname TEXT, firstname TEXT, age INT, country TEXT, childcount INT, PRIMARY KEY(UUID) ); CREATE TABLE users_by_country( country TEXT, firstname TEXT, lastname TEXT, user_uuid UUID, PRIMARY KEY((country), firstname, lastname) ); CREATE TABLE users_by_age( age INT, firstname TEXT, lastname TEXT, user_uuid UUID, PRIMARY KEY((age), firstname, lastname) );
source share