projectNew-comment-fixes.patch

application/octet-stream

Filename: projectNew-comment-fixes.patch
Type: application/octet-stream
Part: 0
Message: Re: ModifyTable overheads in generic plans

Patch

Format: unified
File+
src/backend/executor/nodeModifyTable.c 1 4
src/include/nodes/execnodes.h 7 3
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 6a16752c73..c5a2a9a054 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -377,9 +377,6 @@ ExecComputeStoredGenerated(ResultRelInfo *resultRelInfo,
  *
  * INSERT queries may need a projection to filter out junk attrs in the tlist.
  *
- * This is "one-time" for any given result rel, but we might touch
- * more than one result rel in the course of a partitioned INSERT.
- *
  * This is also a convenient place to verify that the
  * output of an INSERT matches the target table.
  */
@@ -447,7 +444,7 @@ ExecInitInsertProjection(ModifyTableState *mtstate,
  * identity info in the junk attrs.
  *
  * This is "one-time" for any given result rel, but we might touch more than
- * one result rel in the course of a partitioned UPDATE, and each one needs
+ * one result rel in the course of an inherited UPDATE, and each one needs
  * its own projection due to possible column order variation.
  *
  * This is also a convenient place to verify that the output of an UPDATE
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index e7ae21c023..6c21ebb17f 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -425,11 +425,15 @@ typedef struct ResultRelInfo
 	 */
 	AttrNumber	ri_RowIdAttNo;
 
-	/* Projection to generate new tuple in an INSERT/UPDATE */
+	/*
+	 * Projection to generate new tuple in an INSERT/UPDATE and slot to hold
+	 * it. For UPDATE, oldTupleSlot holds the old tuple being updated.
+	 *
+	 * NB: These fields are not to be touched unless you are either
+	 * ExecGetNewInsertTuple() or ExecGetNewUpdateTuple().
+	 */
 	ProjectionInfo *ri_projectNew;
-	/* Slot to hold that tuple */
 	TupleTableSlot *ri_newTupleSlot;
-	/* Slot to hold the old tuple being updated */
 	TupleTableSlot *ri_oldTupleSlot;
 	/* Have the projection and the slots above been initialized? */
 	bool		ri_projectNewInfoValid;