gpdb
gpdb copied to clipboard
[6x] CTE plan ERROR (illegal rescan of motion node) with planner(optimizer = off)
Bug Report
Greenplum version or build
6x
Installation information ( pg_config )
optimizer = off
Step to reproduce the behavior
create table t1(a int, b int); create table t2(a int, b int); create table t3(a int, b int);
insert into t1 values(1, 1); insert into t2 values(1, 1); insert into t3 values(1, 1);
set optimizer = off; postgres=# with cte1 as (select * from t1), cte2 as (select * from t2), cte3 as (select * from t3) select * from cte1 where ( EXISTS ( select cte2.a from cte2 left join cte3 on (EXISTS ( select cte1.b from cte2)))); ERROR: illegal rescan of motion node: invalid plan (nodeMotion.c:1712) (seg1 slice4 127.0.0.1:5003 pid=821) (nodeMotion.c:1712) HINT: Likely caused by bad NL-join, try setting enable_nestloop to off