Storage usage queries leading to primary database CPU saturation

Context

Related to an alert from earlier today (Slack).

We know that storage usage calculation queries are the slowest due to the sheer amount of data that has to be queried. While the long-term goal is to shift these away from Postgres to a more suitable backend (#844), in the recent past we've introduced two changes that are meant to drastically alleviate the load of these in the primary database:

  1. Storage usage query results are cached;
  2. Storage usage queries are routed to replica hosts.

Problem

Being investigated.