The aggregate-event-counts query is quite slow when there are lots of resource events, which can happen by mistakenly creating a recursive file resource. The slow query then breaks the Events page of the console, where a user would go to diagnose those kinds of issues.
The query and explain analyze have been loaded into https://explain.depesz.com/s/IWFD but they are also attached in files for longevity.