Question

we have used Firebird embedded for saving 10 records(each with 400KB BLOB field) into a database file, and the database file size is about 5MB.

We try Compressed BLOB about 30-40%(compressed BLOB size is less than 300KB), but the database file size still 5MB。

How can we make a firebird embedded database file with no or less "empty space".

manually gbak can not cover our situation.

Was it helpful?

Solution

A Firebird database will never shrink without a backup and restore. It will only grow if needed. If database pages have been allocated for a blob, and that blob has been released (because your replaced it with a different blob value), those pages will be marked as available.

When the database needs to allocate new pages, it will first use pages marked as available, and only grow the database if no pages are available. The number of pages it grows is configured in the firebird.conf.

The only way to shrink a database is to perform a backup and restore, but I think if you have about 10 records each with a blob of about 300KB each (which is already 3MB), that the database won't get much smaller depending on the exact growth increment configuration and the size of the rest of the rows

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top