@@ -124,7 +124,6 @@ static BitmapHeapScan *create_bitmap_scan_plan(PlannerInfo *root,
124124static Plan * create_bitmap_subplan (PlannerInfo * root , Path * bitmapqual ,
125125 List * * qual , List * * indexqual , List * * indexECs );
126126static void bitmap_subplan_mark_shared (Plan * plan );
127- static List * flatten_partitioned_rels (List * partitioned_rels );
128127static TidScan * create_tidscan_plan (PlannerInfo * root , TidPath * best_path ,
129128 List * tlist , List * scan_clauses );
130129static SubqueryScan * create_subqueryscan_plan (PlannerInfo * root ,
@@ -203,8 +202,7 @@ static NamedTuplestoreScan *make_namedtuplestorescan(List *qptlist, List *qpqual
203202static WorkTableScan * make_worktablescan (List * qptlist , List * qpqual ,
204203 Index scanrelid , int wtParam );
205204static Append * make_append (List * appendplans , int first_partial_plan ,
206- List * tlist , List * partitioned_rels ,
207- PartitionPruneInfo * partpruneinfo );
205+ List * tlist , PartitionPruneInfo * partpruneinfo );
208206static RecursiveUnion * make_recursive_union (List * tlist ,
209207 Plan * lefttree ,
210208 Plan * righttree ,
@@ -280,7 +278,7 @@ static Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
280278static ProjectSet * make_project_set (List * tlist , Plan * subplan );
281279static ModifyTable * make_modifytable (PlannerInfo * root ,
282280 CmdType operation , bool canSetTag ,
283- Index nominalRelation , List * partitioned_rels ,
281+ Index nominalRelation , Index rootRelation ,
284282 bool partColsUpdated ,
285283 List * resultRelations , List * subplans , List * subroots ,
286284 List * withCheckOptionLists , List * returningLists ,
@@ -1110,8 +1108,7 @@ create_append_plan(PlannerInfo *root, AppendPath *best_path)
11101108 */
11111109
11121110 plan = make_append (subplans , best_path -> first_partial_path ,
1113- tlist , best_path -> partitioned_rels ,
1114- partpruneinfo );
1111+ tlist , partpruneinfo );
11151112
11161113 copy_generic_path_info (& plan -> plan , (Path * ) best_path );
11171114
@@ -1253,8 +1250,6 @@ create_merge_append_plan(PlannerInfo *root, MergeAppendPath *best_path)
12531250 prunequal );
12541251 }
12551252
1256- node -> partitioned_rels =
1257- flatten_partitioned_rels (best_path -> partitioned_rels );
12581253 node -> mergeplans = subplans ;
12591254 node -> part_prune_info = partpruneinfo ;
12601255
@@ -2411,7 +2406,7 @@ create_modifytable_plan(PlannerInfo *root, ModifyTablePath *best_path)
24112406 best_path -> operation ,
24122407 best_path -> canSetTag ,
24132408 best_path -> nominalRelation ,
2414- best_path -> partitioned_rels ,
2409+ best_path -> rootRelation ,
24152410 best_path -> partColsUpdated ,
24162411 best_path -> resultRelations ,
24172412 subplans ,
@@ -5005,27 +5000,6 @@ bitmap_subplan_mark_shared(Plan *plan)
50055000 elog (ERROR , "unrecognized node type: %d" , nodeTag (plan ));
50065001}
50075002
5008- /*
5009- * flatten_partitioned_rels
5010- * Convert List of Lists into a single List with all elements from the
5011- * sub-lists.
5012- */
5013- static List *
5014- flatten_partitioned_rels (List * partitioned_rels )
5015- {
5016- List * newlist = NIL ;
5017- ListCell * lc ;
5018-
5019- foreach (lc , partitioned_rels )
5020- {
5021- List * sublist = lfirst (lc );
5022-
5023- newlist = list_concat (newlist , list_copy (sublist ));
5024- }
5025-
5026- return newlist ;
5027- }
5028-
50295003/*****************************************************************************
50305004 *
50315005 * PLAN NODE BUILDING ROUTINES
@@ -5368,8 +5342,7 @@ make_foreignscan(List *qptlist,
53685342
53695343static Append *
53705344make_append (List * appendplans , int first_partial_plan ,
5371- List * tlist , List * partitioned_rels ,
5372- PartitionPruneInfo * partpruneinfo )
5345+ List * tlist , PartitionPruneInfo * partpruneinfo )
53735346{
53745347 Append * node = makeNode (Append );
53755348 Plan * plan = & node -> plan ;
@@ -5380,7 +5353,6 @@ make_append(List *appendplans, int first_partial_plan,
53805353 plan -> righttree = NULL ;
53815354 node -> appendplans = appendplans ;
53825355 node -> first_partial_plan = first_partial_plan ;
5383- node -> partitioned_rels = flatten_partitioned_rels (partitioned_rels );
53845356 node -> part_prune_info = partpruneinfo ;
53855357 return node ;
53865358}
@@ -6509,7 +6481,7 @@ make_project_set(List *tlist,
65096481static ModifyTable *
65106482make_modifytable (PlannerInfo * root ,
65116483 CmdType operation , bool canSetTag ,
6512- Index nominalRelation , List * partitioned_rels ,
6484+ Index nominalRelation , Index rootRelation ,
65136485 bool partColsUpdated ,
65146486 List * resultRelations , List * subplans , List * subroots ,
65156487 List * withCheckOptionLists , List * returningLists ,
@@ -6538,7 +6510,7 @@ make_modifytable(PlannerInfo *root,
65386510 node -> operation = operation ;
65396511 node -> canSetTag = canSetTag ;
65406512 node -> nominalRelation = nominalRelation ;
6541- node -> partitioned_rels = flatten_partitioned_rels ( partitioned_rels ) ;
6513+ node -> rootRelation = rootRelation ;
65426514 node -> partColsUpdated = partColsUpdated ;
65436515 node -> resultRelations = resultRelations ;
65446516 node -> resultRelIndex = -1 ; /* will be set correctly in setrefs.c */
0 commit comments