Subject Bulk Deletes and Inserts
Author Ian Newby
Hi all,
I have a program which nightly copies a dBase database into an
Interbase database for reporting purposes. The program operates as
follows for each table.

Disable all indexes.
Delete all records (delete from tablename).
Insert all records from the dBase tables (commit every 1000 records).
Activate all indexes.

No tables have primary keys, but some indexes exist.

If I run the program on an empty Interbase table, the filesize is about
180mb. If I rerun the program the file size almost doubles.

I thought that Interbase 6/Firebird 1.0beta automatically reused space
created by deleted records but this does not seem to be the case.

Do I need to sweep the database to stop this happening? The database
statistics are as follows:

Database header page information:
Flags 0
Checksum 12345
Generation 1449
Page size 8192
ODS version 10.0
Oldest transaction 1440
Oldest active 1441
Oldest snapshot 1441
Next transaction 1442
Bumped transaction 1
Sequence number 0
Next attachment ID 0
Implementation ID 16
Shadow count 0
Page buffers 500
Next header page 0
Database dialect 1
Creation date Oct 2, 2001 14:42:23

Variable header data:
Sweep interval: 20000
*END*

Database version Firebird 0.94 on Windows 98/NT.

Regards
Ian Newby.