Subject Re: [Firebird-Architect] Re: the insert into t select * from t infinite loop
Author Jim Starkey
Alexander Klenin wrote:

>On 7/6/05, Ann W. Harrison <aharrison@...> wrote:
>
>
>>A transaction can see its own results
>>because they carry it's transaction number. There's a transaction
>>number on each record, but no statement number. Adding a statement
>>number to records is possible, I guess, but I'm not at all sure that its
>>easier or better than checking for the existence of a record on a
>>statement undo list.
>>
>>
>
>Perhaps there is some merit to the idea of using several transaction
>numbers per transaction?
>Numbers are cheap, just increase the counter by 2 instead of 1.
>Then you can sub-allocate these numbers to different statement "stages".
>
>
>
Transaction numbers are relatively cheap, but not free. Each
transaction consumes two bits on the transaction inventory pages -- two
bits that must be copied and schlepted around by every starting
transaction until the transaction number slips below the old interest
transaction. Each transaction also requires a "dead man's lock" in the
lock table, a fix size resource, and an update to the database header
page to allocate it. Put the various costs together and transaction
numbers don't look cheap at all.