Subject Re: [firebird-support] Database Size
Author Ann W. Harrison
Priebe, Joern (GE Indust, Security) wrote:
> Hello Folks,
> I have (hopefully) an easy question concerning a database's size.

The gstat tool will report on actual space utilization including
back versions. The report will be long, but it will tell you
whether you've got a lot of partially used pages, or retained
back versions.

One thing to note is that your deletes won't actually release
space until you read those records, either in your application
or interactively with a select whose criteria could include them,
or backup the database, or sweep the database.

The delete marks the records as deleted - a deleted record takes
more space than an undeleted record. It is removed only after

1) the transaction that performed the delete commits
2) all transactions concurrent with that transaction complete
3) some transaction attempts to read the record

Gbak reads all records so it can perform the third action, as
can sweep.