My question is that occasionally we see the Oldest Snapshot 'fall behind'. My understanding is that the Oldest Snapshot should always be greater than the Oldest Transaction. If this does occur what does it mean? e.g:

Oldest transaction      56035971
Oldest active           56133318
Oldest snapshot         54052306
Next transaction        58533186

Nope... typically the oldest snapshot is the oldest active - but not always. In this case the oldest snapshot is the oldest transaction that was running when any of the currently active transactions started.

Every transaction that is not READ ONLY READ COMMITTED is assigned a value for the Oldest Snapshot field.

The oldest snapshot is usually the same as the OAT. It represents the actual Transaction ID that aacts is a signal to the garbage collector that there is garbage that needs to be cleared up. The value is not used by any specific transaction itself, but is used by the database as a whole to determine the scope of garbage collection.

""In order to maintain a stable view of the database for Snapshot transactions, Firebird has to avoid garbage collecting records that any running transaction might see. It does so by tracking the oldest transaction that was running when any active transaction started. Each transaction carries with it the identifier of the oldest transaction that was running when it started. Firebird's garbage collection ceiling is set to the oldest of those values among running transactions. When the oldest running transaction stops, Firebird resets the ceiling to the value from the oldest of the remaining transactions.

If a record has two or more versions older than the ceiling value, Firebird can garbage collect the older versions without affecting the stability of any running transaction.."

Like this post? Share on: TwitterFacebookEmail


Related Articles


Author

Firebird Community

Published

Category

Gems from Firebird Support list

Tags