My Usecase
I want to order by timestamp DESC for the results. But I don't want timestamp to be the second column in the primary key as that will take of my querying capability
for example
create table demo(oid int,cid int,ts timeuuid,PRIMARY KEY (oid,cid,ts)) WITH CLUSTERING ORDER BY (ts DESC);
Queries required:
I want the result for all the below queries to be in DESC order of timestamp
select * from demo where oid = 100;
select * from demo where oid = 100 and cid = 10;
select * from demo where oid = 100 and cid = 100 and ts > minTimeuuid('something');
I am trying to create this table with CLUSTERING ORDER IN CQL and getting this error
cqlsh:v> create table demo(oid int,cid int,ts timeuuid,PRIMARY KEY (oid,cid,ts)) WITH CLUSTERING ORDER BY (ts desc);
Bad Request: Missing CLUSTERING ORDER for column cid
In this document it mentions that we can have multple keys for cluster ordering. any one know how to do that?