MERGE minor errata
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 5 Apr 2018 12:19:13 +0000 (13:19 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 5 Apr 2018 12:19:13 +0000 (13:19 +0100)
src/backend/executor/README
src/backend/executor/execMerge.c
src/backend/executor/execPartition.c

index 7882ce44e789c13f8d107197b08f78c0dec32fb3..67736805c2606253b236c03ebdeb042f14452399 100644 (file)
@@ -42,8 +42,8 @@ consists of a super-row that contains all the columns needed by any of the
 individual actions, plus CTID and TABLEOID junk columns. The CTID column is
 required to know if a matching target row was found or not and the TABLEOID
 column is needed to find the underlying target partition, in case when the
-target table is a partition table. When a matching target tuple is found, the
-CTID column identifies the matching target tuple and we attempt to activate
+target table is a partitioned table. When a matching target tuple is found,
+the CTID column identifies the matching tuple and we attempt to activate
 WHEN MATCHED actions. If a matching tuple is not found, then CTID column is
 NULL and we attempt to activate WHEN NOT MATCHED actions. Once we know which
 action is activated we form the final result row and apply only those changes.
index 53f4afff0fbbdf122bd813299ab2621d5f093c28..d39ddd3034598a1cde24edd0722b34c686d88dd2 100644 (file)
@@ -51,7 +51,7 @@ ExecMerge(ModifyTableState *mtstate, EState *estate, TupleTableSlot *slot,
    Datum       datum;
    bool        isNull;
 
-   Assert(resultRelInfo->ri_RelationDesc->rd_rel->relkind ||
+   Assert(resultRelInfo->ri_RelationDesc->rd_rel->relkind == RELKIND_RELATION ||
           resultRelInfo->ri_RelationDesc->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
 
    /*
index 007f00569cef2562da1a1c0e3a1d6789f4a4312b..ad532773a3ab02de797914795c2b1c28b5a9b174 100644 (file)
@@ -314,9 +314,7 @@ ExecFindPartition(ResultRelInfo *resultRelInfo, PartitionDispatch *pd,
  * Given OID of the partition leaf, return the index of the leaf in the
  * partition hierarchy.
  *
- * NB: This is an O(N) operation. Unfortunately, there are many other problem
- * areas with more than a handful partitions, so we don't try to optimise this
- * code right now.
+ * XXX This is an O(N) operation and further optimization would be beneficial
  */
 int
 ExecFindPartitionByOid(PartitionTupleRouting *proute, Oid partoid)