Looks better, and more flexible.I wonder if sqlite has a way to query the number of pages in the freelist ? Probably something like 10% of pages in the freelist would be a good threshold to allow a vacuum.
Oh and btw, read only transactions should disallow vacuum, I think/hope :)