If you work with a large dataset and maintain a good approximation, I highly recommend using the command:
nodetool --host <hostname> cfstats
This will list for each column family, which looks like this:
Column Family: widgets SSTable count: 11 Space used (live): 4295810363 Space used (total): 4295810363 Number of Keys (estimate): 9709824 Memtable Columns Count: 99008 Memtable Data Size: 150297312 Memtable Switch Count: 434 Read Count: 9716802 Read Latency: 0.036 ms. Write Count: 9716806 Write Latency: 0.024 ms. Pending Tasks: 0 Bloom Filter False Postives: 10428 Bloom Filter False Ratio: 1.00000 Bloom Filter Space Used: 18216448 Compacted row minimum size: 771 Compacted row maximum size: 263210 Compacted row mean size: 1634
The line "Number of keys (score)" is a good guess in the cluster, and performance is much faster than explicit calculations.
Justin DeMaris Jan 21 2018-12-21T00: 00Z
source share