【发布时间】:2020-11-24 10:25:22
【问题描述】:
假设我有这张 Cassandra 表:
CREATE TABLE orders (
customerId int,
datetime date,
amount int,
PRIMARY KEY (customerId, datetime)
);
那么为什么下面的查询需要 ALLOW FILTERING:
SELECT * FROM orders WHERE date >= '2020-01-01'
Cassandra 可以只访问所有单独的分区(即客户)并过滤集群键 date。由于 date 已排序,因此无需检索 orders 中的所有行并过滤掉与我的 where 子句匹配的行(据我了解)。
希望有人能赐教。
谢谢
【问题讨论】:
标签: cassandra