MERGE minor errata

This commit is contained in:
Simon Riggs 2018-04-05 13:19:13 +01:00
parent 3af7b2b0d4
commit 01b88b4df5
3 changed files with 4 additions and 6 deletions

View 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 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 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 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 target table is a partitioned table. When a matching target tuple is found,
CTID column identifies the matching target tuple and we attempt to activate 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 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 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. action is activated we form the final result row and apply only those changes.

View File

@ -51,7 +51,7 @@ ExecMerge(ModifyTableState *mtstate, EState *estate, TupleTableSlot *slot,
Datum datum; Datum datum;
bool isNull; 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); resultRelInfo->ri_RelationDesc->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
/* /*

View File

@ -314,9 +314,7 @@ ExecFindPartition(ResultRelInfo *resultRelInfo, PartitionDispatch *pd,
* Given OID of the partition leaf, return the index of the leaf in the * Given OID of the partition leaf, return the index of the leaf in the
* partition hierarchy. * partition hierarchy.
* *
* NB: This is an O(N) operation. Unfortunately, there are many other problem * XXX This is an O(N) operation and further optimization would be beneficial
* areas with more than a handful partitions, so we don't try to optimise this
* code right now.
*/ */
int int
ExecFindPartitionByOid(PartitionTupleRouting *proute, Oid partoid) ExecFindPartitionByOid(PartitionTupleRouting *proute, Oid partoid)