How to prevent database file fragmentation?
As more data is added, the database file grows and Firebird requests the space from the filesystem. In Firebird versions prior to 2.1 this meant that filesystem would give a new page to Firebird each time it’s needed. That can lead to high fragmentation on servers that have a lot of databases or have other programs reading and writing a lot of files. With Firebird 2.1 there is a configuration option in firebird.conf file to allow preallocating the space in bigger ‘chunks’ (128MB is the default). Prior to Firebird 2.1 you can use the trick to simply increase the file size by adding anything to it (zero bytes for example). As Firebird only works with ‘pages’ it wouldn’t mind. Should you decide to do this, make sure you do it when database is not in use (It’s safest to shut down the server completely).
Related Questions
- If I preload my company specific information in the iap.mdb database file, can it be transferred to the new database that comes with a new release or should we keep using the same database file?
- Ive attempted to open a v3.1 SSCE database file using the SSCE 3.5 runtime (still in beta) and it is failing?
- My time records database file is growing really large and slow. How do I Compact and Repair it?