Long loading times for user summary page with slow database

In order to know exactly what is the problem:

  1. Edit the app.yml file and add your admin user email to DISCOURSE_DEVELOPER_EMAILS.

  2. Rebuild

  3. Load the slow page while logged in as the user set in step 1.

  4. Share the result of the mini-profiler

Share the contents from this and the expanded window: