Cassandra cqlsh查询失败,没有错误 [英] Cassandra cqlsh query fails with no error
问题描述
我一直试图运行这样的查询:
I have been trying to run a query like this:
SELECT COUNT(*) FROM sensors WHERE sensor_id = 1 and date = '2014-11';
WHERE子句过滤到具有大约200万列的分区键。我希望得到约计数结果。 2百万,但是我得到这个错误:
on a column family. The WHERE clause filters down to a partition key with around 2 million columns. I expect to get a count result of approx. 2 million, but instead I get this error:
errors={}, last_host=[THE_IP_OF_MY_SERVER]
如果我运行查询以获取列,它返回的数据很好,但它不能返回计数。我了解此类计数查询可能遇到的性能问题(例如此处),但我仍然想为这个查询获得一些结果进行测试。
if I run the query to get the columns it returns the data just fine, but it cannot return the count. I understand the performance issues such count query might have (for example the ones discussed here) but I still would like to get some result for this query for my tests.
所以我的问题是:
- 这是超时错误吗?如果是,我可以如何增加超时时间?
- 如果没有,为什么我得到这个错误?有没有办法获得更多的细节?
我使用的是Cassandra 2.1,
I am using Cassandra 2.1 with cqlsh 5.0.1 and spec 3.2 on a cluster of two nodes both running Ubuntu 14.04.
感谢
推荐答案
它应该是一个超时。如果计划使用范围查询,可以通过更改read_request_timeout_in_ms或甚至range_request_timeout_in_ms(在cassandra.yaml中)的值来增加请求所需的最长时间。
It should be a timeout. You can increase the maximum time needed for the request by changing the value of "read_request_timeout_in_ms" or even "range_request_timeout_in_ms" (in cassandra.yaml) if you plan to use range queries. Restart the cluster after changing the values (they default to 10 seconds).
请注意,如果对分区键运行完全查询,您将获得0或1作为计数。因此,如果返回多于1行,那么您的查询是对聚类列(主键的第一列之后的列)。
Note that if you run exact queries on partition keys you will get 0 or 1 as count. So your query is on clustering columns (the ones after the first column of primary key) if it returns more than 1 row.
这篇关于Cassandra cqlsh查询失败,没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!