]> granicus.if.org Git - postgresql/commitdiff
Fix testing of parallel-safety of scan/join target.
authorEtsuro Fujita <efujita@postgresql.org>
Tue, 12 Mar 2019 07:21:57 +0000 (16:21 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Tue, 12 Mar 2019 07:21:57 +0000 (16:21 +0900)
In commit 960df2a971 ("Correctly assess parallel-safety of tlists when
SRFs are used."), the testing of scan/join target was done incorrectly,
which caused a plan-quality problem.  Backpatch through to v11 where
the aforementioned commit went in, since this is a regression from v10.

Author: Etsuro Fujita
Reviewed-by: Robert Haas and Tom Lane
Discussion: https://postgr.es/m/5C75303E.8020303@lab.ntt.co.jp

src/backend/optimizer/plan/planner.c

index 5e3a7120ffdcf2c4248a11a940ac195f46175bd4..9bb068a52e9d69da8a0187c821f4679dc2e4e745 100644 (file)
@@ -1993,7 +1993,7 @@ grouping_planner(PlannerInfo *root, bool inheritance_update,
                {
                        scanjoin_target = make_group_input_target(root, final_target);
                        scanjoin_target_parallel_safe =
-                               is_parallel_safe(root, (Node *) grouping_target->exprs);
+                               is_parallel_safe(root, (Node *) scanjoin_target->exprs);
                }
                else
                {