reshke opened a new pull request, #1895:
URL: https://github.com/apache/cloudberry/pull/1895

   In some cases planner failed to mark join qual restrict clauses as ones 
referring outer query levels. This makes join motion planning code to make 
wrong query: it uses redistribute motion in cases it shouldn't. 
   In this simple reproduces this leads to motion plan node rescan (this is 
execute-time ERROR normally).  Note that for `generate_series(1,1) t1` it would 
work, because our parametrized plan would execute only once. 
   
   ```
   
   CREATE TABLE t2(i int);
   CREATE TABLE t3(i int);
   
   INSERT INTO t2 SELECT generate_series(1,10);
   INSERT INTO t3 SELECT generate_series(1,10);
   
   select * from  generate_series(1,2) t1, lateral (select t3.i from t2 join t3 
on t2.i = t3.i + t1 order by 1) z;
   
   
   
   ERROR:  illegal rescan of motion node: invalid plan (nodeMotion.c:1368)  
(seg1 slice1 127.0.1.1:7003 pid=879693) (nodeMotion.c:1368)
   HINT:  Likely caused by bad NL-join, try setting enable_nestloop to off
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to