On 9/6/17 9:42 PM, Jacky Lam wrote:
Hi All,
The reason I consider to use VACUUM is that:
when I insert 10k and delete 10k records for a number of times, the db file
size keeps constant in each iteration.
On the other hand, if I terminate the program manually and start the
iteration again, the db file size increase once in the first iteration.
Then it keeps file size constant afterwards.
For example,
1. when no manual termination of program, the file size keeps constant 100kB
2. when I terminate the program and start the iteration again, the file
size changes to 200kB in the first iteration.
3. After the first iteration, the file size keeps at 200kB in later
iterations.

Does anyone can advise me that which parts I am missing for the
Amalgamation compilation of USING *** OTHER VFS ***?

I'm thinking you don't understand why vacuum is not the default. Your examples show good reason why this is.

If an application doesn't delete a lot of records, it doesn't leave a lot of empty space so doesn't need vacuum.

If an application does delete a lot of records, it is very likely in the near future to create a similar number in the near future, so doing a vacuum to temporarily free the space is a lot of work for little gain.

Yes, there is a use case where you delete a lot of records and it will be a long time before more records are created, and perhaps freeing the space may be important, so in that particular case, the program should do the vacuum.

--
Richard Damon

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to