SQLite Deletes Data File Size Remains Unchanged, Empty Data but Large Size

2020年4月1日 46点热度 4人点赞 0条评论
内容目录

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

痴者工良

高级程序员劝退师

文章评论