From 6954a852b359c439414937d60fc00b7a0f91c886 Mon Sep 17 00:00:00 2001 From: amit Date: Fri, 12 Oct 2018 19:12:53 +0900 Subject: [PATCH v7 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 3b3fb304b9..0b0b75d409 100644 --- a/src/backend/optimizer/util/append.c +++ b/src/backend/optimizer/util/append.c @@ -335,10 +335,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. * @@ -374,8 +370,7 @@ expand_partitioned_rtentry(PlannerInfo *root, RangeTblEntry *parentrte, RangeTblEntry *childrte; Index childRTindex; - /* Already locked above. */ - newrelation = heap_open(childOID, NoLock); + newrelation = heap_open(childOID, lockmode); Assert(!RELATION_IS_OTHER_TEMP(newrelation)); /* -- 2.11.0