pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Guo <rguo@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Propagate disabled_nodes to single-child Append paths
Date: Fri, 28 Aug 2026 06:06:57 +0000
Message-ID: <E1wzpjs-00000002Req-17ps@gemulon.postgresql.org> (raw)

Propagate disabled_nodes to single-child Append paths

create_append_path() skips cost_append() when an Append has exactly
one child whose parallel awareness matches its own, since setrefs.c
strips such an Append out entirely.  In that case it copies the
child's rowcount and costs directly, but it failed to copy
disabled_nodes.  An Append over a disabled child therefore claimed to
contain no disabled nodes, letting a disabled path win over one that
is not disabled.

This is a regression in v18; before e22253467, disable_cost was folded
into a path's startup and total costs, so it rode along in the fields
this shortcut already copies.

Back-patch to v18.  This can change plans in stable branches, but only
for installations that have explicitly disabled a node type, and only
to stop using the node they asked us to avoid.

Reported-by: Man Zeng <zengman@halodbtech.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAHewXNm_Zx5EDoaD7wo7bq6cfRroNznS+RBCzT_p2-CWQXpgSw@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/15ccc2041ee864cccc8b72de4a1f21e9b51ccc47

Modified Files
--------------
src/backend/optimizer/util/pathnode.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1wzpjs-00000002Req-17ps@gemulon.postgresql.org>
Permalink:  ../E1wzpjs-00000002Req-17ps@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wzpjs-00000002Req-17ps@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rguo@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Propagate disabled_nodes to single-child Append paths
  In-Reply-To: <E1wzpjs-00000002Req-17ps@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox