Timeseries: Modifying underlying bucket collection for easier queries

I just run the aggregation I posted above for every data retrieval.