Subject | Re: [Firebird-Architect] Re: the insert into t select * from t infinite loop |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-07-02T05:12:25Z |
"David Johnson" <d_johnson@...> wrote:
13) Let QT be the table specified by the <query expression>
...
5) QT is effectively evaluated before insertion of any rows into T.
6) Let Q be the result of evaluating QT.
7) For each row R of Q:
a) A candidate row of T is effectively created
Generally, an open cursor doesn't mean it's materialized.
Dmitry
>And this is what the SQL spec explicitly requires:
> DB2 handles this by performing the select first, then inserting after
> all records have been selected.
13) Let QT be the table specified by the <query expression>
...
5) QT is effectively evaluated before insertion of any rows into T.
6) Let Q be the result of evaluating QT.
7) For each row R of Q:
a) A candidate row of T is effectively created
> 1. open cursor for "select * from a where a.t_val in (select t_val fromAnd perform a full fetch from the cursor into some temporary space.
> t)"
Generally, an open cursor doesn't mean it's materialized.
> This has the downside that it can be very memory intensive.Exactly. And this is a major downside.
Dmitry