question

suujana.naga16_165607 avatar image
suujana.naga16_165607 asked Erick Ramirez answered

Is it ok to run SELECT COUNT (*) FROM keyspace.tablename?

Running production cluster of 6 nodes with 7TB data. How do i retrieve count of a table in prod environment.

Is it ok if run Select count (*) from keyspace.tablename

count
10 |1000

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

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

No, it is not. I've explained the reasons in Why COUNT() is bad in Cassandra.

You will need to use a tool like the DataStax Bulk Loader (DSBulk). It is a tool for efficiently loading and unloading data from Apache Cassandra though that is not the extent of its abilities.

DSBulk has a nice feature for counting data in large tables in a distributed manner. It is open-sourced and free to use. 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.