optimised count of totals for topic messages