Python 在django cassandra引擎中读取cassandra中的超时

Python 在django cassandra引擎中读取cassandra中的超时,python,cassandra,cql,cqlengine,razorsql,Python,Cassandra,Cql,Cqlengine,Razorsql,嗨,我正在python中使用cassandra。我在cassandra中有一个表,它的主键是行_id(uuid)。我有大约2000000条记录(每个分区有一条记录)。当我想获得记录数时: NumberPartitionedLine.objects.count() 我得到这个错误: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Oper

嗨,我正在python中使用cassandra。我在cassandra中有一个表,它的主键是行_id(uuid)。我有大约2000000条记录(每个分区有一条记录)。当我想获得记录数时:

NumberPartitionedLine.objects.count()
我得到这个错误:

Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'consistency': 'LOCAL_ONE', 'received_responses': 0, 'required_responses': 1}
另外,当我在razorsqldatagrip中运行查询
时,从number\u partitioned\u行
中选择count(*), 我得到超时错误,无法得到结果。
原因是什么?

您正试图从200万个分区中读取数据,这在Cassandra中是不推荐的

如果不受分区键的限制,那么进行计数(*)将给节点增加很大的压力,在您的情况下,您不能按分区进行限制,因为每个分区只有一条记录

在您的情况下,最好使用柜台-


您可以调整内存分配或增加yaml等中的超时,但这只会有助于将问题推迟到以后。

您需要增加提供给Cassandra DB服务器的内存分配。