On 6 Jul 2010, at 10:45pm, Kristoffer Danielsson wrote:

> Q: How do I programmatically (through sqlite-APIs?) determine if it's time to 
> VACUUM a database?

It's never time to VACUUM a database.  The VACUUM command is useful only if you 
have want to recover unused space from the database file.  So if your database 
file once took up 5 Meg, and you deleted a lot of data from it and it now takes 
up only 2 Meg, you could recover 3 Megabytes of disk space.  But how useful is 
that 3 Megabytes of space to you ?  Are you going to use it for something 
really valuable ?  And how long will it be before you get 3 Megabytes more data 
which will fill it up again ?

If you're trying to get the database in shape to make copies, e.g. to burn it 
on a DVD or send it to customers, or put it on a device with limited space, 
then there might be some reason to use VACUUM.  If not, then it's just a waste 
of resources.

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

Reply via email to