How do I find the size of a table in Cassandra Keyspaces?

Viewed 44

I have used this command to get the size of a table

nodetool cfstats -- <Keyspace>.<table name>

But, I am not sure whether it is right or wrong as if I upload more rows into my table, "Space Used" is not changing only "Memtable data size" is changing.

I just wanna know how to find the size of a table in cassandra keyspaces.

1 Answers

When a node receives a mutation (a write), it first gets persisted in a commit log then written to a memtable. The mutations/writes are not persisted to a SSTable until the memtable is flushed to disk.

If you want to force the memtables to be flushed to disk, run:

$ nodetool flush -- ks_name table_name

For more info, see How data is written in Cassandra. Cheers!

Related