Respect disabled_nodes in fix_alternative_subplan.
Robert Haas <rhaas@postgresql.org>
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>
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/costsize.c | modified | +1 −0 |
| src/backend/optimizer/plan/setrefs.c | modified | +10 −4 |
| src/include/nodes/primnodes.h | modified | +1 −0 |
Discussion
- pg_plan_advice 219 messages · 2025-10-30 → 2026-06-10