Uh oh!
There was an error while loading. Please reload this page.
Conversation
reshke
commented
Aug 17, 2026
@yjhjstz maybe interesting for you |
901375f to
0462744Compare| -> Seq Scan on tenk1 t1 | ||
| -> Hash | ||
| -> Broadcast Motion 3:3 (slice3; segments: 3) | ||
| Nested Loop |
There was a problem hiding this comment.
The Nested Loop sits directly above the Gather Motion 3:1, so the whole join runs serially on the coordinator (QD) instead of segment-local. Is that intended, or should the join happen below the Motion so it stays parallel across segments?
There was a problem hiding this comment.
Yep this is intended. The before-plan is better in term of performance, expect it is not valid ;). We receive executor-time error becuase of motion rescan. The after-fix plan is worse, but can be executed correctly. In fact, the sole thing this PR do is correctly use infrastructure committed at 00e25afe119c
There was a problem hiding this comment.
in fact, I think pushing down join below the motion is possible, so some types of plans. But this is separate problem, in this PR I merely try to fix ERROR: illegal rescan of motion node:
There was a problem hiding this comment.
I think these two link can help in understanding
https://github.com/apache/cloudberry/blob/main/src/backend/cdb/cdbpath.c#L1417-L1421
https://github.com/apache/cloudberry/blob/main/src/backend/cdb/cdbpath.c#L1585-L1594
I found a planner bug while backporting 14.8 - 14.9 range in REL_2_STABLE #1843
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) t1it would work, because our parametrized plan would execute only once.As we can see, Redistribute Motion uses
Hash Key: (t3.i + t1.t1)which is parametrized by outer rel (t1).With fix: