Subject Re: [firebird-support] Database continuously growing
Author Svein Erling Tysvaer
Hi!

"Please give me some helps" isn't a sensible subject (this is a support
list, and 95% of messages in this list could use this title), so I
changed it to "Database continuously growing".

Tell us more about your database. How big is it, and how is it growing?
Do you only do inserts or also deletes/updates? What about your
statistics, most importantly next transaction, oldest interesting
transaction and oldest active transaction?

I am asking because Firebird keeps old record values available as long
as they may be interesting. At certain points in time, the values may
differ for one particular record, and a transaction may be interested in
the value stored at the time of its' start rather than the most current
value. Likewise with deletes, an old transaction may still use records
deleted since it started. Hence, if you have lots of updates/deletes and
doesn't take properly care of your transactions, you may end up with a
database that is far bigger than it ought to be.

Another thing to notice with database size is that Firebird reuses space
rather than give it back to the operating system. Of course you can save
some space by deleting the last 5 years of data and then do a
backup/restore, but e.g. doing it daily to shrink the database and then
see the database grow back to the same size before the end of day is a
waste of time. Once no transaction can possibly be interested in a
deleted record anymore, the space it occupied can be used again by
Firebird, and so the database should stop to grow.

If the database continues to grow indefinitely even though the amount of
data in the database doesn't increase (i.e. you delete as much as you
insert), you have a problem with your transactions.

HTH,
Set

hfsnell wrote:
> Hi everybody !
> I am using Firebird 1.5.3 for my application. Day by day my database
> is bigger and bigger. My boss ask me for a solution to make the size
> of database small by backing up the old information and delete it from
> the database but when users need access it they can.
> Is there a way I know the last time a record was accessed?
> or Is there a solution to solve my problem?
> Any idea will be appriciated!