Subject Re: [firebird-support] Number of Firebird Users
Author Stefan Heymann
> I have INSERT about 100000 records in a Table, the size of the FB Database grew up to 15MB

> I DELETE the records the size remains 15MB.

That is normal. A Firebird database is organized in pages that are
allocated when needed. When you delete the records, the pages will be
marked as free and will be reused when you add more data.

> After BACKUP and RESTORE thru FlameRobin then the size was reduce to 788Kb

That is also normal because GBAK (the tool that FlameRobin calls to do
the job) will build the new database from scrath and then fill it with
the data from the backup (also done with GBAK) that you have done
before. So there are no empty pages after the Restore.

> Is this normal ? or can it me done automatically within the settings
> and configs

As I said before, you don't have to do it because Firebird will reuse
the unused pages before it will allocate new pages. So there is
nothing to worry about.

If you want to do it anyway on a regular basis you can write a batch
file that calls GBAK (which is a command-line tool) for a backup and
then again for a restore. However, you must be aware that the database
will not be usable during the restore and that everything that is
added/changed/deleted in the database *after the time the backup has
started* is lost.


Best Regards

Stefan