From 289fff1a50deead4b2b743d62056b613a916c221 Mon Sep 17 00:00:00 2001 From: amit Date: Fri, 12 Oct 2018 19:12:53 +0900 Subject: [PATCH v5 6/6] Do not lock all partitions at the beginning --- src/backend/optimizer/util/append.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/backend/optimizer/util/append.c b/src/backend/optimizer/util/append.c index 2ca8e8d0ff..f1627aef33 100644 --- a/src/backend/optimizer/util/append.c +++ b/src/backend/optimizer/util/append.c @@ -291,10 +291,6 @@ expand_partitioned_rtentry(PlannerInfo *root, RangeTblEntry *parentrte, parentrel->inh_root_parent : parentRTindex; - /* If root partitioned table, lock *all* partitions in the tree. */ - if (parentRTindex == rootParentRTindex) - (void) find_all_inheritors(parentrte->relid, lockmode, NULL); - /* * Initialize partitioned_child_rels to contain this RT index. * @@ -328,8 +324,7 @@ expand_partitioned_rtentry(PlannerInfo *root, RangeTblEntry *parentrte, Relation newrelation; RelOptInfo *childrel; - /* Already locked above. */ - newrelation = heap_open(childOID, NoLock); + newrelation = heap_open(childOID, lockmode); Assert(!RELATION_IS_OTHER_TEMP(newrelation)); /* -- 2.11.0