Subject | Re: [firebird-support] Internal Firebird question. |
---|---|
Author | Ann Harrison |
Post date | 2012-05-21T19:21:16Z |
Fabiano,
There are several issues around reusing space from deleted records.
1) When you delete, what actually happens is that Firebird creates a new
record version that indicates that the record is deleted (aka "deleted
stub"), but does not actually delete the old record. If your transaction
fails, Firebird will remove the deleted stub.
2) When your delete is visible to all active transactions, both the deleted
stub and the previous version of the record will be garbage collected,
which just means that their index entries on the page will be set to 0:0 -
no offset, no length. The records stay on the page, but their length is
added to the free space on page.
3) New records may or may not use the space formerly used by the deleted
record. If there's free space on the page that's easier to use, Firebird
will use it first.
4) Eventually, the free space on page will show enough space for a new
record, but there won't actually be enough contiguous space for the record.
Only then is the page reorganized, overwriting the old, dead data.
Good luck,
Ann
[Non-text portions of this message have been removed]
There are several issues around reusing space from deleted records.
1) When you delete, what actually happens is that Firebird creates a new
record version that indicates that the record is deleted (aka "deleted
stub"), but does not actually delete the old record. If your transaction
fails, Firebird will remove the deleted stub.
2) When your delete is visible to all active transactions, both the deleted
stub and the previous version of the record will be garbage collected,
which just means that their index entries on the page will be set to 0:0 -
no offset, no length. The records stay on the page, but their length is
added to the free space on page.
3) New records may or may not use the space formerly used by the deleted
record. If there's free space on the page that's easier to use, Firebird
will use it first.
4) Eventually, the free space on page will show enough space for a new
record, but there won't actually be enough contiguous space for the record.
Only then is the page reorganized, overwriting the old, dead data.
Good luck,
Ann
[Non-text portions of this message have been removed]