question

gmldba_107428 avatar image
gmldba_107428 asked Erick Ramirez edited

How can I get a row count? SELECT COUNT(*) returns ReadTimeout error

I am trying to do a select count(*) from keyspace.table; (is a dev environment). I am getting the following error:
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'}

How can I get a row count on a table?

countquery
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

dave.bechberger avatar image
dave.bechberger answered gmldba_107428 commented

There are several ways you can get a count on a table such as using the driver to count by token range or using DSE Analytics but I would suggest that the easiest way is likely to use the DataStax Bulk Loader known as dsbulk. One of the features available in dsbulk is being able to perform a count operation on a table. There was a good blog post on this a little while back which you can see here:


DataStax Bulk Loader - Counting

1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

gmldba_107428 avatar image gmldba_107428 commented ·

Is this application free to use commercially?

0 Likes 0 ·
Erick Ramirez avatar image
Erick Ramirez answered

@gmldba_107428 you will need a current DataStax subscription to use DSBulk on DataStax Enterprise (DSE) or DataStax Distribution of Apache Cassandra (DDAC) clusters. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.