The schema I am using is following :
CREATE TABLE mytable(
id varchar,
date date,
name varchar,
PRIMARY KEY ((date),name, id)
) WITH CLUSTERING ORDER BY (name desc);
I have 2 queries for my use case :
- Fetching all records for given
name
- Delete all records for given
date
.
As we can't delete records without partition key being specified, my partition key got fixed to date
only and no other column can be added to partition key as I won't have anything except date
at time of deletion.
But to fetch records using name
, I need to use ALLOW FILTERING
as I need to scan whole table of above schema which causes performance issue.
Can you suggest a better way so that I can skip ALLOW FILTERING
with is also delete by date
compatible.