in reply to Hash Math

You don’t talk about underlying databases but I feel sure that there must be one, in which case could you not use an SQL query with GROUP BY to simply obtain the statistics directly?