How to know, when it is time to vacuum an sqlite database file?
1
vote
1
answer
102
views
Sqlite, contrary most SQL-compatible DB engine, is working directly on files instead over network sockets. It is also not very good in concurrency, beside that deletion operators are mostly advisory (i.e. do not free the places of the deleted entities).
That results that an sqlite database needs regularly be
VACUUM
-ed, at least those with regular modify or delete operations. Vacuum works by rebuilding the database file, without the free spaces in it. Needless to say, it is absolutely non-concurrent with anything, making it to a costly operation - we have downtime for the vacuum.
*However, I think there should exist some indicator which compares the size of the database file to the size of the actual data in it.*
Using this indicator, it could be said, do we need a vacuum-ing or not.
Does it exist?
Asked by peterh
(2137 rep)
Apr 11, 2025, 10:16 AM
Last activity: Apr 15, 2025, 11:40 AM
Last activity: Apr 15, 2025, 11:40 AM