On Mon, Jan 21, 2008 at 09:59:08AM -0500, Igor Tandetnik wrote:

> The point of VACUUM is to reclaim pages freed by deleting records (or by 
> updating with less data, e.g. by removing large BLOBs). If you don't 
> modify the database, there's no reason to VACUUM it.
> 
> And of course, if you really want to, you can detach a database, open it 
> again directly, and vaccuum it on that new connection.

OK, perhaps I wrote not enough:

http://www.tcl.tk/community/tcl2004/Papers/D.RichardHipp/drh.html

In the paper above I've found a ready-to-use recipe, which I'm using since,
because is very practical. First I'm copying the data from "physical file"
into "memory database", then I'm operating in memory - and, at the end of
work, all the memory contents is written back into the file.

So, I'm deleting the file contents first:

  SELECT name FROM sqlite_master WHERE type='table'
  DELETE FROM $name

...then attaching "physical" file...

  ATTACH /full/path/to/dbase AS app

...and then putting the "memory database" contents into file:

  SELECT name FROM sqlite_master WHERE type='table'
  INSERT INTO app.$name SELECT * FROM $name

...detaching it in the end: DETACH app

So, back to my question: do I need VACUUM at all?
-- 
                                pozdrawiam / regards

                                                Zbigniew Baniewski

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to