COUNT is a database aggregate function that returns how many rows match a SELECT query’s WHERE clause instead of returning the rows themselves. section 7.1.5
Use COUNT with the same querying rules as other ScyllaDB queries:
- Count rows in a specified partition with COUNT(*), such as the five article summaries in date bucket 0. section 7.1.5
- Include at least the partition key in the query and do not filter by non-primary-key values. section 7.1.5
- Avoid counting an entire table when possible: ScyllaDB must inspect every partition, so the operation becomes more expensive as records increase. section 7.1.5
Count published article summaries
Run SELECT COUNT(*) FROM article_summaries_by_date WHERE date_bucket = 0; ScyllaDB returns one result containing count = 5. section 7.1.5
cqlsh:reviews> SELECT COUNT(*)
FROM article_summaries_by_date
WHERE date_bucket = 0;
View the complete cqlsh query for counting rows in a date partition. section 7.1.5




