SQLite – Reduce db file size after removed the records

After i have removed some log entries in a SQLite DB, I found that the database file size stay the same. This is because SQLite will keep the used space and reuse them later.

We can use the VACUUM command to release the empty space.

sqlite3 <your_sqlite_db_file> "VACUUM;"

 

Done =)

Reference:

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.