Subject Re: AW: [firebird-support] VACUUM
Author Helen Borrie
At 07:52 PM 15/10/2004 +0800, you wrote:

>Thanks for your responses.
> >From this site ( ), I find
>the following command to turn *off* automatic sweeping.:
>gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -h 0
>Is automatic sweeping configured by default?


>How can I see the configuration?

from the bin dir of your Firebird setup:

gstat -h Yourdatabase -u sysdba -pass ftsecvgg

(Yourdatabase can be path or alias)

Sweep interval is at the bottom of this report. Default is 20000. If it
is 0, auto-sweeping is disabled.

>If I run the following command (I believe its to 'sweep database
>now'), will it turn *on* automatic sweeping?

No. It will sweep the database now. :-)

> I can't seem to find how
>to turn automatic sweeping on (considering if this command doesn't).

Auto sweeping is enabled by setting the sweep interval to something more
than zero. When well-written applications are used, auto-sweeping never
occurs. Basically, write good applications and run manual sweeps
periodically to get the database into shape. Just leave the sweep interval
as-is. If you are writing bad apps (those that are careless about
committing work or which keep transactions open for long periods) you're
going to need the extra sweeps.

>gfix -user SYSDBA -password masterkey dbserver:/db/mydb.fdb -s

Something along those lines does the same thing as your "sweep database
now" thingie. Switch order matters - consult the IB6 Ops Guide if you
don't have a firebird book.

Note that garbage collection and sweeping are not the same thing. GC goes
on all the time (if it can) but careless transaction management will
inhibit it.

You also get GC performed when you run a backup unless you switch it off,
as you would do if you intend to create a fresh database for immediate use
from the backup. GC never releases space left by deletes.