City stats timeing out

The citystats section is timing out on any city with a non-trivial amount of data.

For example, when I go to see Seattle:

If I click on the stats icon, the spinner appears, and then 30 second later, it finally times out.
I see that the request for chart.json times out after 30 seconds.
I can go to some of my cities that I only have a few activities on and see stats, but cities with large number of activities seem to break.

:link: My profile link :

Yeah, there are some beastly queries in there that can be working with years of data. :sweat_smile: Thanks for pointing out that timeouts are happening - I’ll try and take a look at that soon.

If you are working on this query, would you consider adding a “total time” metric to this stats section? I think it’s an interesting number and might not be that difficult to implement when you are already aggregating the distance there.