Subject Re: [firebird-support] database size remains constant after deletion of records
Author Alexandre Benson Smith
deepak_cs_mca_2006 wrote:
> Hi,
> I am using Firebird database version 1.5 for storing records. All
> the operations (mostly inserts and read)
> are working correctly.
> My problem is that, when I delete older records (sometimes in a
> bulk) from the database to reduce the size of the database,
> records get deleted but database size remains the same. Is there a
> way to reduce the size of the database after delete operation has
> deleted many records.
> I tried to call gfix -sweep but the size is still shown to be the
> same.
> My guess is that garbage collection has happenned with gfix-sweep,
> but compression has not taken place.
> Is this the correct functionality of gfix-sweep? If it is, then is
> there a way that I call compression on the database
> file explicitly so that I can reduce the size of the database file
> after the gfix-sweep has taken place.
> Please help.
> Thanx in advance
> regards
> Deepak Gupta


This is FAQ, search the archives for a very complete and detailed

I will give a brief one:

The unused space (by the removed records) will be re=used o the new
inserted records, this is far more fast then ask the OS disk space again.

The only way to reduce the database size is to do a back-up/restore cycle.

The gfix-sweep will remove unneeded record versions and mark the space
as available, but will not shrink the database file.

Removing records are generally not necessary to keep the database fast,
and disk space is almost free nowadays. So do you really need to reduce
the database file size ?

see you !

Alexandre Benson Smith
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil