The space occupied by deleted records will be reused as soon as it is garbage collected by Firebird. If the GC does not happen (transaction problems?), The DB will continue to grow until the GC can do its job.
In addition, there is a problem when you do a massive deletion in a table (for example, millions of records), the next choice in this table “starts” garbage collection, and performance will decrease until the GC finishes. The only way to get around this is to make massive deletions at a time when the server will not be used, and start a cleanup after that, making sure that there are no stuck transactions.
Also keep in mind that if you use “standard” tables to store temporary data (that is, information is inserted and deleted several times), you may get a damaged database in some cases. I highly recommend you start using the global temporary table feature.
Warmbooter
source share