Vacuum currently only happens if database files exceed 4 GB, but should probably happen under more circumstances
Through #379 (closed) I discovered that the reason tracker was using 2 GB for its Documents cache DB file was that it was indexing a big collection of about 2000 epub ebooks on my system, that I don't care to see indexed. My disk space is very limited and precious and I try to keep my caches to a minimum, so I added "ebooks" and "epub" as folders to be ignored in the ignored-directories
gsetting of org.freedesktop.Tracker3.Miner.Files
. However, this did not result in the cache/database file shrinking. It was then pointed out that while tracker is supposed to vacuum on restarting the gnome session, tracker currently only considers vacuuming if the file exceeds 4 GB, because vacuuming can be an expensive operation.
Ideally, it should be a bit smarter than that. Maybe it could evaluate how much potential there is to save by vacuuming, by
- knowing how many entries are gone from the filesystem, or ignored, and determining the weight or percentage this represents?
- triggering a vacuum a while after the
ignored-directories
orignored-directories-with-content
orignored-files
ormax-bytes
gsettings have changed? - considering how full the filesystem is?
- once every two weeks or something?
- upon new version upgrades?