Very slow Sidekiq issue with large queue due to massive numbers of unread user notifications

Your notifications table is still massive. Compare, for instance, meta:

notifications               | 1230140      | 316 MB     | 581 MB     | 897 MB    

Try this (the first may briefly cause errors or read-only while it runs):

VACUUM FULL VERBOSE notifications
and
REINDEX DATABASE «yourdatabasename»

And then can you re-post the stats?

(looking at the other tables, your posts table also has massive indexes - on meta we have 3933 MB with only 674 MB of indices. If you can take a brief window of downtime I would recommend VACUUM FULL VERBOSE which will do the entire DB, followed by the reindex.)

10 Likes