Subject Re: Firebird DB Size
Author Adam
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
> Adam wrote:
> >>
> >>Is there any thing to decrease DB size?
> >>
> >
> > 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.
>
> That's true in general, but blobs are not handled like other data.
> Unless you modify the blob field, all versions of the record point
to
> the same instance of the blob. When a record is garbage collected,
part
> of the process checks whether the blob is referenced in record
versions
> that persist, in which case the blob is not removed. So if you
have a
> record that contains a blob and modify only non-blob fields,
there's one
> copy of the blob. If you modify the blob field, then you get a
second
> copy of the blob and the first copy will eventually be garbage
collected.
>
> Regards,
>
>
> Ann

Thanks Ann (and Ivan),

Well there you go, you do learn something new every day. In any case,
if the transactions are not managed, then modifying BLOB fields will
be a huge problem, because old transactions effectively prevent the
old BLOB from being garbage collected.

Still, it is good to know that you don't have to move BLOB fields to
a different table to achieve this result.

Adam