【发布时间】:2015-01-28 10:44:43
【问题描述】:
让我们考虑从http://planetcassandra.org/blog/getting-started-with-time-series-data-modeling/ 获取的下表
CREATE TABLE temperature
(
weatherstation_id text,
event_time timestamp,
temperature text,
PRIMARY KEY (weatherstation_id,event_time)
);
所以weatherstation_id 是分区键,event_time 是集群列。
数据被加载到该表中,然后我们运行查询:
SELECT COUNT(1) FROM temperature WHERE weatherstation_id = '1234ABCD'
所以实际上我们要求的是底层 cassandra 存储行中的列数。
1) 它是 O(1) 操作吗?
2)如果不是 - 如何在计算 cassandra 存储行中的列时实现 O(1)?使用计数器?
(我使用的是 Cassandra v2.0.11)
谢谢
【问题讨论】: