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