0

I have installed Cassandra on cluster consist of 4 nodes (8 cores and 50 gigabyte RAM ) . and I have inserted 85 Million row in Cassandra table about 28 gigabyte of data . i want to count all rows in the table and i have used this query

select count(*) from page_viewes; 

this query takes around 30 min . my question is . how to reduce this time ?

Ashraful Islam
  • 12,470
  • 3
  • 32
  • 53
  • What is your `page_viewes ` table schema ? – Ashraful Islam Jun 13 '17 at 13:12
  • 4
    [Cassandra doesn’t maintain such counts, unlike the indexing structures used in relational databases. It’s not that someone didn’t bother to implement it, such a count would violate many of Cassandra’s principles.](https://www.datastax.com/dev/blog/counting-keys-in-cassandra) – OneCricketeer Jun 13 '17 at 13:13
  • Use counter https://stackoverflow.com/a/44218675/2320144 – Ashraful Islam Jun 13 '17 at 13:16

0 Answers0