Slow Sidekiq + Postmaster using 95%+ CPU (32 cores) after Postgresql Version Upgrade

Maybe try running:

VACUUM FULL VERBOSE;

and (assuming your db name is ‘discourse’ which is default):

REINDEX DATABASE discourse;

This might be better than normal reindex, but I haven’t tested it: PostgreSQL 12 update