pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Propagate disabled_nodes to single-child Append paths
3+ messages / 1 participants
[nested] [flat]

* pgsql: Propagate disabled_nodes to single-child Append paths
@ 2026-08-28 06:06  Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Richard Guo @ 2026-08-28 06:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Propagate disabled_nodes to single-child Append paths
@ 2026-08-28 06:06  Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Richard Guo @ 2026-08-28 06:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/de5659440dbcfe0ef61b474cec0e5ec50a9c3841

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Propagate disabled_nodes to single-child Append paths
@ 2026-08-28 06:06  Richard Guo <rguo@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Richard Guo @ 2026-08-28 06:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/718f281672a91856f0d241aa5602d4d14f055a93

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-08-28 06:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-28 06:06 pgsql: Propagate disabled_nodes to single-child Append paths Richard Guo <rguo@postgresql.org>
2026-08-28 06:06 pgsql: Propagate disabled_nodes to single-child Append paths Richard Guo <rguo@postgresql.org>
2026-08-28 06:06 pgsql: Propagate disabled_nodes to single-child Append paths Richard Guo <rguo@postgresql.org>

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