]> granicus.if.org Git - postgresql/commitdiff
Fix minor thinko in pathification code.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Mar 2016 21:50:32 +0000 (16:50 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Mar 2016 21:50:44 +0000 (16:50 -0500)
I passed the wrong "root" struct to create_pathtarget in build_minmax_path.
Since the subroot is a clone of the outer root, this would not cause any
serious problems, but it would waste some cycles because
set_pathtarget_cost_width would not have access to Var width estimates
set up while running query_planner on the subroot.

src/backend/optimizer/plan/planagg.c

index 9d6c181e365db7ae09b1723a52ffb3a064a1d489..cefec7bdf1083cbc3f0ee3b47db63893ff41f755 100644 (file)
@@ -465,7 +465,7 @@ build_minmax_path(PlannerInfo *root, MinMaxAggInfo *mminfo,
         * cheapest path.)
         */
        sorted_path = apply_projection_to_path(subroot, final_rel, sorted_path,
-                                                                                  create_pathtarget(root, tlist));
+                                                                                  create_pathtarget(subroot, tlist));
 
        /*
         * Determine cost to get just the first row of the presorted path.