From c4bb5ca72406b7e94d60401ee6a696924b6f938b Mon Sep 17 00:00:00 2001 From: amit Date: Mon, 25 Mar 2019 13:16:10 +0900 Subject: [PATCH v36 2/7] Get rid of duplicate child RTE for partitioned tables We create duplicate RTE for partitioned tables just because we do so for regular inheritance parent tables. But unlike the regular inheritance parents which are themselves regular tables and thus need to be scanned, partitioned tables don't need it. In retrospect, 30833ba154e could have been done this. --- src/backend/optimizer/util/inherit.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/backend/optimizer/util/inherit.c b/src/backend/optimizer/util/inherit.c index 1fa154e0cb..b89e8a5f81 100644 --- a/src/backend/optimizer/util/inherit.c +++ b/src/backend/optimizer/util/inherit.c @@ -273,11 +273,6 @@ expand_partitioned_rtentry(PlannerInfo *root, RangeTblEntry *parentrte, root->partColsUpdated = has_partition_attrs(parentrel, parentrte->updatedCols, NULL); - /* First expand the partitioned table itself. */ - expand_single_inheritance_child(root, parentrte, parentRTindex, parentrel, - top_parentrc, parentrel, - appinfos, &childrte, &childRTindex); - /* * If the partitioned table has no partitions, treat this as the * non-inheritance case. -- 2.11.0