Okay, so this is Rebased. Your comment about soapbox-be confused me.
First run htop. Are you using too much CPU/RAM or not enough? If not enough, you need to tweak the settings until you’re using more.
It’s most likely one of two issues:
There’s a data migration running that’s hammering your db. Query select * from data_migrations; to check its progress.
A new index on activities is not fully built or is corrupted. Are you running Postgres 14?
As graf mentioned in the other comment, a vacuum can help. So can upgrading to Postgres 14 if you aren’t already.
The data migration will take time. Once it’s done, performance will also improve.
If htop says you’re not using enough resources, or you want to scale it up, I can help you tweak postgres to improve your situation. In particular, max_work_mem should be increased if you have the RAM for it.