Subject Re: [firebird-support] Backup Time
Author Ann W. Harrison
Louis Werth wrote:
> Hi
>
> I recently began with a database cleanup procedure, I deleted about 4Gig of
> data out of a 9gig database.

When Firebird deletes a record, it doesn't remove the record from
the database. Instead, it creates a new version of the record,
without data, marked as deleted. When the transaction that did
the delete commits, and all concurrent transactions exit, the next
transaction that touches the record removes the deleted stub and
all earlier versions of the record. This is particularly expensive
if there are indexes with lots of duplicates in V1.x.
>
> Before the script, it took about 1hour to backup database and 1.5hours to
> restore. Cleanup Script takes about 14min to complete.
>
> Backup after script takes 12hours to backup and 1.5 to restore.
>
> What can I do to speed this up? I cannot afford that my client go down for
> 13Hours +
>

Backup with the -g switch if you expect to replace the existing database
with a restored backup. That makes gbak skip the garbage collection -
removing old record versions - phase of reading the database.


Regards,


Ann