unread
unread copied to clipboard
`cleanup_read_marks` killing database CPU for hours?
Hey all!
I'm getting a weird issue when I run cleanup_read_marks on all readable tables, it takes ~10 hours to run to completion and takes up 90% of the DB CPU time.
Would love any information on how the cleanup works and how to make it faster!
Thanks in advance!
Things that I can think of as causes:
- Missing database indices
- First cleanup after years without cleanup
- Your database is so large that this gem is not the right solution
Look here for the internals of the cleanup: https://github.com/ledermann/unread/blob/master/lib/unread/garbage_collector.rb