On Thu, 2009-11-26 at 05:01 +0100, Pavel Stehule wrote:
> It working like:
>
> 1. EXECUTE SELECT 0 FROM generate_series(1,...);
> 2. STORE RESULT TO TABLE zero;
> 3. EXECUTE SELECT 1/i FROM zero;
> 4. STORE RESULT TO TABLE tmp;
>
> Problem is in seq execution. Result is stored to destination after
> execution - so any materialisation is necessary,
>
My example showed that steps 3 and 4 are not executed sequentially, but
are executed together. If 3 was executed entirely before 4, then the
statement: insert into tmp select 1/i from zero;
would have to read the whole table "zero" before an error is
encountered.
However, the statement errors immediately, showing that steps 3 and 4
are pipelined.
Regards,Jeff Davis