Long loading times for user summary page with slow database

Have you migrated, modified or rebuilt the same database over and over? It’s possible your database needs a vacuum to update the statistics. 30s queries are way out of the normal range we see in Discourse installs (although admittedly your DB is large.)

VACUUM FULL is worth trying if you can accept some downtime.