For secondary index queries that have a partition key specified in the WHERE clause, does the secondary index search perform all nodes in the cluster or only the node of the specified partition key?
If the latter is true, then the secondary index will also work well for fields with high power (only for queries that satisfy the partition key).
EDIT: for example, for the following feed scheme, requesting a specific feed (specified by feed_id) to retrieve existing or deleted feeds should be very efficient:
CREATE TABLE my_feed ( feed_id int, item_id timeuuid, is_deleted boolean, data text, PRIMARY KEY (feed_id, item_id) ) WITH CLUSTERING ORDER BY (item_id DESC); CREATE INDEX my_feed_is_deleted_idx ON my_feed (is_deleted); ==> SELECT * FROM my_feed WHERE feed_id=1 AND is_deleted=false; --efficient?
source share