Subject Re: [ib-support] Automatic garbage collection?
Author Paul Reeves
Omar Estepa wrote:
> Hi,
> We was having problems with our Linux database server (about 6 GB,
> IBSS_LI-V6.0), it seems to be overloaded by garbage collection (after mass
> deletion, I think). No problem, I go to our backup/restore daily script and
> add the "-g" option to gbak commands and it works fine. The database check
> tells me everything is OK and backups works fine (with "-g").

gbak -g causes gbak to run with garbage collection disabled. You should only
add this switch if you are going to use the subsequently restored database in

> But few days later we have de same problem, the server slows down again
> (100% CPU time usage) when the users was working (no backup/restore process
> was running at this time). Auto-sweep is turned off.

You shouldn't turn auto-sweep off in 6.0. That was a v4/v5 thing.

> Can the IB server automatically run the garbage collection? If it can, can I
> dissable this feature? Does anybody have another idea?

V6 saw the introduction of background threads to handle garbage collection.
You really shouldn't need to change sweep from its default value.

If you are doing mass deletes then there are a couple of things to look at.
Firstly, if the contents of the entire table are to be deleted then dropping
the table and recreating it is cheaper than deleting records. There is even a
new command in Firebird to assist this.

If you are not deleting all the records in a table then look at disabling the
non-system indexes on the table prior to the delete and activating them again
when the delete has been committed.


Paul Reeves
taking InterBase further