Cassandra 协调器读取超时计数操作 vs select all

Cassandra coordinator read timeout count operation vs select all

我有 4 个节点 dse 5.1.2 Cassandra 集群,平均每个节点有 3 GB data.i 我正在尝试查询该数据。我知道我不应该做下面的查询,因为它对 cassandra 有不好的影响。但我观察到的是

select * works , but select count(*) fails

在同一个 table 上与协调器 timeout.when 都在读取时在后台执行相同的操作,为什么不同。 我的集群已 100% 修复,并且在 table 中没有发现墓碑。我还在 cqlsh 命令中增加了读取请求超时。

我收到以下查询错误

select count(*) from xxx.xxxx;

ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}

如果您是 运行 通过 cqlsh 执行的那些命令,那么它们并不完全相同。

cqlsh 的默认限制为 10000 行,因此除非您更改了该限制,否则您将获得 select * 的全部内容。

select count(*) 将对所有节点进行全面 table 扫描以获取计数,因此超时。