Subject | Re: [Firebird-Architect] Re: the insert into t select * from t infinite loop |
---|---|
Author | Alexander Klenin |
Post date | 2005-07-06T09:02:42Z |
On 7/6/05, unordained <unordained_00@...> wrote:
This is safe and simple, but expensive -- might require 2x page writes.
--
Alexander S. Klenin
Insight Experts Ltd.
> So let's say you start a transaction by grabbing t# 1000 and 1001.After the end of statement, update all changed records back to #1000.
>
> You start your insert-from-select (would be infinite) and tell it to -only- see records that would
> have existed as of 1000, and ignore 1001 records. It inserts all new records as 1001. (Generalize
> this to insert/update/delete changes.)
>
> Now you start a second statement doing something similar, in the same transaction. But you're still
> using 1000 and 1001. Now what?
This is safe and simple, but expensive -- might require 2x page writes.
> You'd have to grab a new transaction number for every statement, not just two, effectively using itOf course. This is why I proposed pre-allocating the numbers.
> as a compound key. How this might affect savepoints is beyond me, but I have a strange feeling it'd
> go badly. Plus, it messes with the transaction < transaction math.--
--
Alexander S. Klenin
Insight Experts Ltd.