In Aerospike I have a set ac_1_2015-06-13_15
which contains the spending information of an account 1 on 2015-06-13 broken down by 15 minute segments, that is, every record represents a 15 minute segment within the day. Since there are 4 15-minute segments in an hour and 24 hours in a day, there are 96 records. Every record has a single bin spend
.
To calculate the total spend in the day I used AerospikeClient.scanAll()
summing up all the spend values:
totalSpend += record.getDouble("spend");
This takes 351 milliseconds. Is there a more efficient way to calculate the sum or this is it?