secondary-indexes

how to avoid secondary indexes in cassandra?

亡梦爱人 提交于 2019-11-27 13:08:51
问题 I have heard repeatedly that secondary indexes (in cassandra) is only for convenience but not for better performance. The only case where it is recommended to use secondary indexes when you have low cardinality (such as gender column which has two values male or female) consider this example: CREATE TABLE users ( userID uuid, firstname text, lastname text, state text, zip int, PRIMARY KEY (userID) ); right now I cannot do this query unless I create a secondary index on users on firstname