So our install of TTRSS has been slowly getting slower and slower. The DB is hammering the hell out of the disks which is the main culprit, but I decided to look further to see if some of the cleanup wasn’t working, when I popped open the error log to see if anything was showing up, when I got a lot of errors related to foreign key constraints.
I’m wondering if at this point it might be worthwile to OPML export, wipe, import on a clean/new DB. Only thing stopping me from doing that right now is there’s ~54 users, and I will hate my life moving that many people over one-by-one.
Biggest culprit was
DELETE FROM ttrss_entries WHERE NOT EXISTS (SELECT ref_id FROM ttrss_user_entries WHERE ref_id = id), which ran for an hour+ before dying with:
ERROR: update or delete on table "ttrss_entries" violates foreign key constraint "ttrss_enclosures_post_id_fkey" on table "ttrss_enclosures" DETAIL: Key (id)=(19496237) is still referenced from table "ttrss_enclosures".