【发布时间】:2018-04-04 12:33:18
【问题描述】:
CREATE TABLE IF NOT EXISTS myns.mytable (
"id" text, -- unique id,
"inserted" timestamp,
"score" int, -- score
PRIMARY KEY (("id","score"), "inserted"))
WITH CLUSTERING ORDER BY (inserted asc);
您认为有更好的方法来对此进行建模吗?我要查询 我的表在:
1. find by id - #use ALLOW FILTERING error
2. find by score - #use ALLOW FILTERING error
3. find by id and score - works
我只想擅长查询表以通过 id 或分数范围或两者来获取对象。你认为我应该在分数上创建一个二级索引吗?
【问题讨论】: