On 12/10/2013 3:04 PM, veeresh kumar wrote:
I wanted to know what is the good way to execute Vacuum command.
- Inside a transaction or without transaction?

Doesn't really matter (unless you want to combine it with other statements in a single transaction). VACUUM command is no different from, say, a large UPDATE statement. Like any other statement in SQLite, if it's not part of an explicit transaction, it will create an implicit one, just for this statement.

- What would happen if we terminate the Vacuum command in-between when its not 
executed in a transaction? Does the database gets corrupted if we stop/kill the 
operation inbetween?

Same thing that happens if you interrupt an UPDATE statement: the usual rollback mechanism will repair the damage eventually.

-If we put inside a transaction, definitely we would get a SQLITE_BUSY 
error.Any way to avoid this error?

You would get this error whether or not you start an explicit transaction. There is no way to use the database while VACUUM runs.
--
Igor Tandetnik

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

Reply via email to