Subject | Re: Firebird DB Size |
---|---|
Author | Adam |
Post date | 2005-07-25T00:05:09Z |
--- In firebird-support@yahoogroups.com, "Bisey" <biseydegil@y...>
wrote:
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
wrote:
> Hi,to
>
> As a new Firebird user, I have one major problem. I created an
> Firebird database with 3 tables. Major table has 22 fields and two of
> them are BLOB fields. Anyway, I started posting records to database
> see how far is DB size is going. After 3000 records (each of them hasgenerates
> one picture in BLOB field), DB size became 1.76 GB. One picture is
> 76.7 KB. So 76.7 * 3000 = 224 MB approx. How become Firebird
> 1.5 GB for text-only data? DB size is important for me, becauseHello Can Abdullah Karaca,
> project is coded to hold more than 7000 records.
>
> Is there any thing to decrease DB size?
>
> Thanks,
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