SQLite does not actually delete data; instead, it moves the data to free pages. This can cause the database size to increase over time.
The vacuum
command copies the contents of the main database into a temporary database file, then clears the main database and reloads the original database from the copy. This eliminates free pages, arranges the data in tables contiguously, and also cleans up the database file structure.
This means that if the database size is too large, you can execute the vacuum
command (SQL) to clear the cache and defragment the database.
https://www.runoob.com/sqlite/sqlite-vacuum.html
文章评论