Reduce number of queries for creating stats (do it like a sir!)