Subject Re: [firebird-support] backup very slow and how often sweep a database ?
Author Ann Harrison
Stéphane,

> the probleme is that the sweep can take up to 5 hours to finish and the
> backup up to 12 hours to finish :(
> i know that in the backup i don't put the -g params (inhibit garbage
> collection) but someone say me that
> the -g do something else that the gfix.exe -sweep doesn't do ...

As others have said, sweep does something that gbak doesn't. Specifically,
sweep resets the "oldest interesting transaction" - the first transaction in the
system that may have rolled back leaving changes in the database. Keeping
that number accurate was very important a decade ago when memory was
expensive and rare and Firebird did not automatically undo changes when
a transaction rolled back leaving the server alive.

When reading records, Firebird must check the state of transactions newer
than the oldest interesting. At startup, Firebird produces a bit
vector of those
transactions where each pair of bits indicates the transactions state:
rolled back,
committed, limbo, or active. The shorter the vector, the better, but 64K bits
isn't as interesting as it was a decade ago.
>
> now i need to know, how often i need to launch the gfix.exe -sweep and
> the gbak.exe -B without the -g params ? everydays seam not anymore
> possible because of the time taken
> by these process...
>
> one time a month ?
>
Backup as often as lets you sleep at night. Sweep once a week if possible,
once a month if not.

Good luck,

Ann