Subject Re: sweep rule of thumb timings
Author csswa
The only index on the db is a primary key index on an integer pk
field.

sweeps of the db via gfix (no other connections) take the same time:
16 min. Watching the server process I can see the db file being
walked sequencially from beginning to end at about 100k per second.
This contrasts with a backup which rips along at 1 meg per second
(gbak with default settings)!

Gfix sweeping is a lot lighter on system resources (virtually none)
than gbak, though.

Header reveals:

Page size 4096
ODS version 10.0
Oldest transaction 287
Oldest active 288
Oldest snapshot 288
Next transaction 289

So no weirdness there.

Regards,
Andrew Ferguson


--- In ib-support@y..., "Ann W. Harrison" <aharrison@i...> wrote:
> No, sweeping and garbage collect eliminate both the record
> and references to it in indexes. It finds the records by
> walking through the tables sequentially (natural order).
>
> To remove entries from indexes, the code gets the value from
> the record version it's removing, checks that the values isn't
> used in a version of the record that's staying (reasonably cheap,
> unless you do something like modifying the same record 500
> while some transaction is open). If the value no longer applies
> to the record, Firebird/InterBase goes to the index and looks for
> the value paired with the record id. Only values propagate up in
> the index, so it must examine all entries in the index with that
> value until it finds the one with the matching record id. Here's
> the nasty bit. Duplicates are stored at the front of the chain,
> so the oldest records are last. Walking a table in natural order
> removes the oldest records first.
>
>
>
>
> Regards,
>
> Ann
> www.ibphoenix.com
> We have answers.