Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the size of a table in Cassandra?

Tags:

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?

like image 964
Mouna Avatar asked Dec 30 '14 09:12

Mouna


People also ask

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

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.

How do I find the size of a column in Cassandra?

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.

How do I tell the size of a Cassandra partition?

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.

How do I find the number of rows in a Cassandra table?

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.


1 Answers

nodetool cfstats -- <keyspace>.<table> 

will give you the 'Space used' by a table.

like image 136
mikea Avatar answered Oct 24 '22 07:10

mikea