Question

I have a sqlite database created by a C# application (.Net Framework + System.Data.SQLite).

Whenever I manipulate my SQLite database file using other tools, like "SQLITE Administrator", the size of my database file is increasing significantly (e.g. 448KB --> 804KB)

My source DB is in SQLITE 3 format and destination is the same.

Information stored in db are unicodes. However I'm not sure if they are UTF-8,UTF-16 or something else.

Changes that I apply to db include changing column names and stuff like this.

I'm going to use this Database as an asset in mobile application, so size is a big concern.

Do you have a clue why this is happening and how it can be prevented?

Was it helpful?

Solution

Unfortunately, we don't know what exactly different SQLite database tools can do with database file. But you should pay attention to the VACUUM SQLite command.

The VACUUM command cleans the main database by copying its contents to a temporary database file and reloading the original database file from the copy. This eliminates free pages, aligns table data to be contiguous, and otherwise cleans up the database file structure. See more on documentation.

So, as a workaround solution, you can apply this command to your database, when you finished to work with it in any specific tool.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top