Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

rajib76 avatar image
rajib76 asked Erick Ramirez answered

Is there an easy way to find out the average row size of a table?

Is there an easy way to find out the average row size of a table in DSE Cassandra?

metrics
10 |1000

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

steve.lacerda avatar image
steve.lacerda answered

Hi! You can gather some information from sstablemetadata:

https://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/tools/toolsSStables/toolsSSTableMetadata.html

As the example given in the link above:

Count               Row Size        Cell Count
1                          0          10237522
22                         0               189
24                         0               636
45                      2148              6467
56                      1256              5679
78                       570             15803

The output varies by version though, so it depends on what version of Cassandra or dse you're on.

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.

Erick Ramirez avatar image
Erick Ramirez answered

You can run this command to get statistics on a table:

$ nodetool tablestats ks_name.table_name

One of the statistics collected for tables is the Compacted partition mean size which shows the average partition size for a table.

Note that almost all nodetool commands only provide information about a specific node. If you want the average for the whole cluster, you will need to run the command on all nodes.

For more info, see the nodetool tablestats page in the Docs. 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.