Subject Re: [ib-support] GBAK question
Author Alexander V.Nevsky <ded@hq.bereg.net>
--- In ib-support@yahoogroups.com, ir000387@m... wrote:
> Helen,
>
> I read on an Interbase forum that doing a select count(*) from
<tablename> performs a GC on that table. Is this true in Firebird?

I'm not Helen but yes, it's true but one condition is needed -
there should'nt be transactions interested in old versions of recodrs
to allow treat them as garbage and collect them. This condition is
applied to all other cases of garbage collection.

> If I don't do a back/restore, does Firebird reuse the empty data
pages for new data? If yes, I suppose that's where the data
fragmentation comes from...

Yes. But this _data_ fragmentation means near to nothing. Much more
important is indices disbalance.

> So, it look like I'm going to have to do a backup/restore
periodically.

It is recommended for all of us - it is the only way to rebuild
system indices which support constraints.

> All updates and inserts are committed immediately. However, I have a
couple of DBGrids that display data from a select query. One of these
never closes while the application is running. Is this considered an
"uncommitted" transaction?

Yes and this the reason for your initial problem with sweep. In
Firebird you can start such a transaction in read only read commited
mode and eleminate their bad influence - such a transactions are
started in "commited" state. The same in IB6.5 and higher, but not in
IB6.0x.

Regards. Ded.