On Mon, Aug 17, 2026 at 3:59 PM Tender Wang <[email protected]> wrote:
> The problem is in `create_append_path()`.  When an Append has only one
> child and both have the same parallel-awareness, it skips
> `cost_append()` and copies the child's rows and costs directly:
...
> However, `child->disabled_nodes` is not copied.  As a result, an
> AppendPath whose child has `disabled_nodes = 1` can incorrectly have
> `disabled_nodes = 0`, which affects subsequent path selection.

Good catch, and the fix is right.  setrefs.c removes such an Append so
the node is gone at execution time and copying the child's count
verbatim is what we want.

I think we need to update the comment above this code.  Also, I don't
think we need the test case.  None of previous fixes to oversights of
this shape carried test case, such as 47c110f77 and 6e466e1e8.  A
plan-shape test here does not seem stable enough.

For the same reason as those commits, I'd also leave this master-only.
It is a v17 regression, but planner fixes risk destabilizing plans in
stable branches, and this doesn't seem severe enough to be an
exception.

I plan to push the attached patch if there are no objections.

- Richard

Attachment: v2-0001-Propagate-disabled_nodes-to-single-child-Append-p.patch
Description: Binary data

Reply via email to