Can we take a step sideways? It might be slow, but why is it BIG, and why did it get so much bigger so quickly?
There’s a similar thread over here.
Slow library performance due to increasingly growing database
I’m wondering if you’d run a few of those same queries to identify which parts of the database have gotten so big.
Either sqlite3_analyzer or this to start:
sqlite3 com.plexapp.plugins.library.db "select name, sum(pgsize) as size from dbstat group by name order by size desc limit 20;"