I want to count the total number of columns for a Cassandra row using Hector client. Currently I am doing this with a CountQuery
, but it seems really slow to me. Also for a row, with just 60k columns it's taking nearly 2 seconds. My code currently looks like this:
QueryResult<Integer> qr = HFactory.createCountQuery(ksp, se, se).
setColumnFamily("ColumnFamily1").
setKey("RowKey").
setRange(null, null, 1000000000).execute();
PS: I have to set the range to such a high number, otherwise it only counts me max. to the number I've provided in the range.
Any ideas how I can improve this?