]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Back-patch "Fix parallel hash join path search."
authorAmit Kapila <akapila@postgresql.org>
Fri, 14 Sep 2018 03:06:21 +0000 (08:36 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 14 Sep 2018 03:06:21 +0000 (08:36 +0530)
Back-patch commit 655393a022bd653e2b48dbf20b69236981e35195 to 9.6.  This
synchronizes the relavant code and helps in generating parallel paths in
some cases in 9.6.  This also helps in back-patch of future patches where
we can get the same plan in all branches.

Discussion: https://postgr.es/m/CAA4eK1+XK_875cJA1HPVpx9C7C8Fp7i4QzLJ17T3igfU2iadxQ@mail.gmail.com

src/backend/optimizer/path/joinpath.c

index 83abb585c2ac0bfa20442a4ba4bea14c8e8e1226..14492583e2fd5dffa6942499f5ffbd5e338aa306 100644 (file)
@@ -1469,9 +1469,9 @@ hash_inner_and_outer(PlannerInfo *root,
                        /*
                         * Normally, given that the joinrel is parallel-safe, the cheapest
                         * total inner path will also be parallel-safe, but if not, we'll
-                        * have to search cheapest_parameterized_paths for the cheapest
-                        * safe, unparameterized inner path.  If doing JOIN_UNIQUE_INNER,
-                        * we can't use any alternative inner path.
+                        * have to search for the cheapest safe, unparameterized inner
+                        * path.  If doing JOIN_UNIQUE_INNER, we can't use any alternative
+                        * inner path.
                         */
                        if (cheapest_total_inner->parallel_safe)
                                cheapest_safe_inner = cheapest_total_inner;
@@ -1479,7 +1479,7 @@ hash_inner_and_outer(PlannerInfo *root,
                        {
                                ListCell   *lc;
 
-                               foreach(lc, innerrel->cheapest_parameterized_paths)
+                               foreach(lc, innerrel->pathlist)
                                {
                                        Path       *innerpath = (Path *) lfirst(lc);