I want to khnow what is the size of a table in Cassandra.
Is there a query in cqlsh similar to show dbs
in mongodb?
If not is there another way to get the size of tables?
If you need to know informaiton about table or tables you can use Nodetool cfstats command. Syntax: If you will only provide the name of keyspace, it will provide stats for all the tables in that keyspace.
A map reduce job might be the best way to calculate exact column sizes. What I would recommend is when you insert your column you also insert the size of the data you are storing in another CF/column.
You can find the total number of partitions available for a table with nodetool command. ./nodetool cfstats <keyspace>. <table>. If you know the partition key, you can fire a select count(*) for the partition to get no. of the records in that partition.
A SELECT expression using COUNT(*) returns the number of rows that matched the query. Alternatively, you can use COUNT(1) to get the same result.
nodetool cfstats -- <keyspace>.<table>
will give you the 'Space used' by a table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With