views:

77

answers:

2

How can I compact Firebird 2.1 database, like we do in MS Access (discarding erased data, remaking index, etc)?

There's a way to do it?

Thanks!

+1  A: 

The only way to do it is to make a backup and a restore.

Eduardo Mauro
Brazilian, Eduardo? Me to! Thanks for advicing!
darth_alexious
Yes, I am. Fell free to contact me.
Eduardo Mauro
+1  A: 

Usually there is no need to compact a Firebird Database: see fb release notes about garbage collection and an automatic (per-database configurable) operation named "sweep". In few words, fb reuses space in pages when records are deleted or oldest record version are freed asking for disk space chunks only when free space becomes too small (i.e. under a defined percent). Sweep is performed as default after a predefined number of commited transactions, bur it's an expensive task. Backup and restore must be intended as last resort to optimize and shrink, as this rebuilds and optimize indexes too, but usually this is not needed as there are commands and tools to rebuild indexes.

Thanks! excelent answer!
darth_alexious