pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Respect disabled_nodes in fix_alternative_subplan.
Date: Thu, 26 Mar 2026 14:38:02 +0000
Message-ID: <E1w5lqT-001YPx-2u@gemulon.postgresql.org> (raw)

Respect disabled_nodes in fix_alternative_subplan.

When my commit e22253467942fdb100087787c3e1e3a8620c54b2 added the
concept of disabled_nodes, it failed to add a disabled_nodes field
to SubPlan. This is a regression: before that commit, when
fix_alternative_subplan compared the costs of two plans, the number
of disabled nodes affected the result, because it was just a
component of the total cost. After that commit, it no longer did,
making it possible for a disabled path to win on cost over one that
is not disabled. Fix that.

As usual for planner fixes that might destabilize plan choices,
no back-patch.

Discussion: https://postgr.es/m/CA+TgmoaK=4w7-qknUo3QhUJ53pXZq=c=KgZmRyD+k7ytqfmgSg@mail.gmail.com
Reviewed-by: Lukas Fittl <lukas@fittl.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/47c110f77e75ed7efd54c3b152f7da2350522f8c

Modified Files
--------------
src/backend/optimizer/path/costsize.c |  1 +
src/backend/optimizer/plan/setrefs.c  | 14 ++++++++++----
src/include/nodes/primnodes.h         |  1 +
3 files changed, 12 insertions(+), 4 deletions(-)



Message-ID: <E1w5lqT-001YPx-2u@gemulon.postgresql.org>
Permalink:  ../E1w5lqT-001YPx-2u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w5lqT-001YPx-2u@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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Respect disabled_nodes in fix_alternative_subplan.
  In-Reply-To: <E1w5lqT-001YPx-2u@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