trying to optimize query
cache aggregate results for one day