Is index database pruned automatically or I have to do it myself?
I had relatively large folder I was syncing (1m files/1TB) and it made index database substantially larger - as expected. Now I have stopped sharing it and only have tiny shares left. But index database remains as big as before.
My share folder is still present - I removed all data from it. Now there are mere 10 files there I share.
I don’t mind to delete index as reindexing is fast for me now. It would though be nice if index database is sometimes cleaned from old no more valid data.
I removed share completely and restarted syncthing. Interestingly initially index size went slightly up but then shrunk - not to the size I would expect though. Roughly from 1GB to 500MB.
I waited few minutes - no change. I stopped syncthing, deleted index and started again. When all shares were indexed it is now 20MB.
It is not show stopper but definitely low priority bug or area of improvement. It might affect only heavy users’ cases and potentially lead to performance degradation. Difficult to quantify it. But it would be nice if database is “compacted” sometimes.
There’s two parts to this - what data we decide to keep / remove in the database, and how / when the database compacts itself. The latter is something we don’t really tune or control right now, so it can take a while from when something substantial is removed to when the database actually shrinks on disk. As for what we remove in the first place … removed folders are cleared out. Removed devices are not, I think. Deleted files are indeed not, because we need the history, but the blocks for it are.
Again not the biggest bug but I can definitely see that removed folders are not cleared out - at least not entirely. In my case even after 10 days database has hundreds of megabytes - when all folders are removed but one containing just few files (and it is the new one so no major history). In longer run it will require manually deleting database.