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:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s