LogVacuum
Used to reclaim the storage space occupied by deleted data in SQLite after clearing logs with the LogReset() function.
LogVacuum()Examples
Clear all logs, then reclaim the space used by the database.
javascript
function main() {
LogReset()
LogVacuum()
}
python
def main():
LogReset()
LogVacuum()
rust
fn main() {
LogReset(0);
LogVacuum();
}See Also
Remarks
The reason is that SQLite does not immediately reclaim the occupied storage space when deleting data; the VACUUM command must be executed to clean up the data tables and free up space. This function triggers a file move operation when called, resulting in significant latency, so it is recommended to call it at appropriate time intervals.