I am working on Cassandra version 2.1.13.1218 and cqlsh version 5.0.1.
For a given table, when I run cfstats
command, Compacted partition maximum bytes is greater than Space used (total). For example:
Compacted partition maximum bytes: 4.64 MB
and
Space used (total): 2.28 MB.
Total space used by a table should always be higher since all large/small partition sizes are part of the total space of the given table. How can compacted partition maximum byte size be higher than total space used for the table?
Command is: ./cqlsh cfstats keyspace.columnfamilyname -H
Can someone help me understand this and what is the different between Space used (live) and Space used (total)?
The Space used indicates how much space is used by the table on disk. This depends on the OS and the compression ratio. Whereas the Compacted partition max bytes is just max encountered partition size (after compaction). This is based on the data modeling/schema and logical record size used. For instance, 100kb record size times 40 records (each going into the same partition) will give you a 4MB partition.
This when it sits on the disk may be compressed further and you may get 2MB on disk. Can you share the rest of the stats too (compression info for ex, min and avg size, number of keys)?