Subject Re: Firebird DB Size
Author Bisey
Thank you for reply. My application is really simple and based on one
major table. It has simple functions: add, edit, and delete functions,
also some queries about this table. So there are really not complex
transactions.

I can think about your suggestion for storing images. But I just want
to use these images with master table and didn't want to create a
detail one.

Is there any way to delete the garbage flagged records? Such as a
compact and repair option?

Thanks,
Can

>
> Hello Can Abdullah Karaca,
>
> Firebird is a multi-generational architecture database (MGA). When you
> change a field, it makes a copy of the record rather than changing the
> existing record. When no other transactions that might be interested in
> the old value of a record are around, the old record is flagged as
> garbage, and eventually will be re-used.
>
> A couple of things may be happenning here. You may have lots of
> unnecessary back versions because you may not manage your transactions
> well.
>
> You may benefit from a small change in database structure.
>
> For example:
>
> test
> (
> id,
> textfield1,
> textfield2,
> imagefield1
> )
>
> could be changed to
>
> test
> (
> id,
> textfield1,
> textfield2
> )
>
> testimages
> (
> id,
> testid,
> imagefield1
> )
>
> create a foreign key from testimages.testid referencing test.id on
> update cascade on delete cascade
>
> etc
>
> Because you probably do not modify the images too often, this would
> perform better because no back version information is needed for the
> image information.
>
> Also, Firebird will not give the disk space back to the OS even if it
> is not using it all anymore. Asking the OS for disk space can be
> expensive performance wise, so Firebird will use what it has first and
> only ask for more if it runs out.
>
> Adam