Subject | Re: [firebird-support] Garbage Collection question/problem |
---|---|
Author | Helen Borrie |
Post date | 2008-08-22T14:23Z |
At 19:47 22/08/2008, you wrote:
Just get used to the idea of a database server that manages its own disk space. When it can't find a page belonging to a table or index that has enough space for a write, it gets a fresh page from the OS. So, in early days, your database file will seem to grow more than the amount of data you put there. If you write applications in such a way that garbage is dealt with in a regular and timely manner, your database will reach an equilibrium point where space is reused efficiently and database growth will reflect data growth.
./heLen
>Hello,No, the database size never gets smaller. Once garbage has been dealt with, the space those obsolete records were using is released for re-use.
>
>I use Firebird embedded 2.0.3 on Windows XP and as far as I know,
>garbage collection is disabled or nearly ineffective for embedded
>databases.
>
>I tried gfix -sweep but the database size does not change by 1 byte.
>The only solution I've found so far is a full backup/restoreYes. Sweep and garbage collection are not meant to make databases smaller and they never do.
>procedure (gbak -B/gbak -R).
>
>Am I overlooking something ?
>Why doesn't gfix -sweep works ?Sweep works. So does the background GC worker thread. But they won't remove garbage that remains interesting to active transactions.
>Is there a better way to force garbage collection for embedded databasesgfix -sweep *is* a command-line utility. And you can't "force" garbage collection to get rid of obsolete records that the database engine thinks you want to keep.
>(connection string option, command line utility, ...) ?
Just get used to the idea of a database server that manages its own disk space. When it can't find a page belonging to a table or index that has enough space for a write, it gets a fresh page from the OS. So, in early days, your database file will seem to grow more than the amount of data you put there. If you write applications in such a way that garbage is dealt with in a regular and timely manner, your database will reach an equilibrium point where space is reused efficiently and database growth will reflect data growth.
./heLen