From c808fa83c4682f1c352d7d96e3fb712f8a82fe41 Mon Sep 17 00:00:00 2001
From: David Fetter <david@fetter.org>
Date: Tue, 14 May 2019 22:53:19 -0700
Subject: [PATCH v4 5/8] Changed code comments to reflect the new default
 spelling
To: hackers
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.21.0"

This is a multi-part message in MIME format.
--------------2.21.0
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 2beb378145..8c4320df58 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -2365,7 +2365,7 @@ FindTriggerIncompatibleWithInheritance(TriggerDesc *trigdesc)
  *		trigdata: trigger descriptor.
  *		tgindx: trigger's index in finfo and instr arrays.
  *		finfo: array of cached trigger function call information.
- *		instr: optional array of EXPLAIN ANALYZE instrumentation state.
+ *		instr: optional array of EXPLAIN EXEC instrumentation state.
  *		per_tuple_context: memory context to execute the function in.
  *
  * Returns the tuple (or NULL) as returned by the function.
@@ -2406,7 +2406,7 @@ ExecCallTriggerFunc(TriggerData *trigdata,
 	Assert(finfo->fn_oid == trigdata->tg_trigger->tgfoid);
 
 	/*
-	 * If doing EXPLAIN ANALYZE, start charging time to this trigger.
+	 * If doing EXPLAIN EXEC, start charging time to this trigger.
 	 */
 	if (instr)
 		InstrStartNode(instr + tgindx);
@@ -2455,7 +2455,7 @@ ExecCallTriggerFunc(TriggerData *trigdata,
 						fcinfo->flinfo->fn_oid)));
 
 	/*
-	 * If doing EXPLAIN ANALYZE, stop charging time to this trigger, and count
+	 * If doing EXPLAIN EXEC, stop charging time to this trigger, and count
 	 * one "tuple returned" (really the number of firings).
 	 */
 	if (instr)
@@ -4171,7 +4171,7 @@ afterTriggerDeleteHeadEventChunk(AfterTriggersQueryData *qs)
  *	rel: open relation for event.
  *	trigdesc: working copy of rel's trigger info.
  *	finfo: array of fmgr lookup cache entries (one per trigger in trigdesc).
- *	instr: array of EXPLAIN ANALYZE instrumentation nodes (one per trigger),
+ *	instr: array of EXPLAIN EXEC instrumentation nodes (one per trigger),
  *		or NULL if no instrumentation is wanted.
  *	per_tuple_context: memory context to call trigger function in.
  *	trig_tuple_slot1: scratch slot for tg_trigtuple (foreign tables only)
@@ -4216,7 +4216,7 @@ AfterTriggerExecute(EState *estate,
 		elog(ERROR, "could not find trigger %u", tgoid);
 
 	/*
-	 * If doing EXPLAIN ANALYZE, start charging time to this trigger. We want
+	 * If doing EXPLAIN EXEC, start charging time to this trigger. We want
 	 * to include time spent re-fetching tuples in the trigger cost.
 	 */
 	if (instr)
@@ -4359,7 +4359,7 @@ AfterTriggerExecute(EState *estate,
 		ExecClearTuple(LocTriggerData.tg_newslot);
 
 	/*
-	 * If doing EXPLAIN ANALYZE, stop charging time to this trigger, and count
+	 * If doing EXPLAIN EXEC, stop charging time to this trigger, and count
 	 * one "tuple returned" (really the number of firings).
 	 */
 	if (instr)
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index ed7c0606bf..cbbc7e087b 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -390,7 +390,7 @@ standard_ExecutorRun(QueryDesc *queryDesc,
  *
  *		This routine must be called after the last ExecutorRun call.
  *		It performs cleanup such as firing AFTER triggers.  It is
- *		separate from ExecutorEnd because EXPLAIN ANALYZE needs to
+ *		separate from ExecutorEnd because EXPLAIN EXEC needs to
  *		include these actions in the total runtime.
  *
  *		We provide a function hook variable that lets loadable plugins
@@ -1365,7 +1365,7 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
  * on other relations, which will be processed in the context of the outer
  * query.  For efficiency's sake, we want to have a ResultRelInfo for those
  * triggers too; that can avoid repeated re-opening of the relation.  (It
- * also provides a way for EXPLAIN ANALYZE to report the runtimes of such
+ * also provides a way for EXPLAIN EXEC to report the runtimes of such
  * triggers.)  So we make additional ResultRelInfo's as needed, and save them
  * in es_trig_target_relations.
  */
diff --git a/src/backend/executor/execParallel.c b/src/backend/executor/execParallel.c
index 3d4b01cb4d..adcccbbdcb 100644
--- a/src/backend/executor/execParallel.c
+++ b/src/backend/executor/execParallel.c
@@ -273,11 +273,11 @@ ExecParallelEstimate(PlanState *planstate, ExecParallelEstimateContext *e)
 									 e->pcxt);
 			break;
 		case T_HashState:
-			/* even when not parallel-aware, for EXPLAIN ANALYZE */
+			/* even when not parallel-aware, for EXPLAIN EXEC */
 			ExecHashEstimate((HashState *) planstate, e->pcxt);
 			break;
 		case T_SortState:
-			/* even when not parallel-aware, for EXPLAIN ANALYZE */
+			/* even when not parallel-aware, for EXPLAIN EXEC */
 			ExecSortEstimate((SortState *) planstate, e->pcxt);
 			break;
 
@@ -486,11 +486,11 @@ ExecParallelInitializeDSM(PlanState *planstate,
 										  d->pcxt);
 			break;
 		case T_HashState:
-			/* even when not parallel-aware, for EXPLAIN ANALYZE */
+			/* even when not parallel-aware, for EXPLAIN EXEC */
 			ExecHashInitializeDSM((HashState *) planstate, d->pcxt);
 			break;
 		case T_SortState:
-			/* even when not parallel-aware, for EXPLAIN ANALYZE */
+			/* even when not parallel-aware, for EXPLAIN EXEC */
 			ExecSortInitializeDSM((SortState *) planstate, d->pcxt);
 			break;
 
@@ -1294,11 +1294,11 @@ ExecParallelInitializeWorker(PlanState *planstate, ParallelWorkerContext *pwcxt)
 											 pwcxt);
 			break;
 		case T_HashState:
-			/* even when not parallel-aware, for EXPLAIN ANALYZE */
+			/* even when not parallel-aware, for EXPLAIN EXEC */
 			ExecHashInitializeWorker((HashState *) planstate, pwcxt);
 			break;
 		case T_SortState:
-			/* even when not parallel-aware, for EXPLAIN ANALYZE */
+			/* even when not parallel-aware, for EXPLAIN EXEC */
 			ExecSortInitializeWorker((SortState *) planstate, pwcxt);
 			break;
 
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 64eec91f8b..c6a2906db5 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -193,7 +193,7 @@ MultiExecPrivateHash(HashState *node)
 	if (hashtable->nbuckets != hashtable->nbuckets_optimal)
 		ExecHashIncreaseNumBuckets(hashtable);
 
-	/* Account for the buckets in spaceUsed (reported in EXPLAIN ANALYZE) */
+	/* Account for the buckets in spaceUsed (reported in EXPLAIN EXEC) */
 	hashtable->spaceUsed += hashtable->nbuckets * sizeof(HashJoinTuple);
 	if (hashtable->spaceUsed > hashtable->spacePeak)
 		hashtable->spacePeak = hashtable->spaceUsed;
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index 92d0507949..cd5e834ae9 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -3215,19 +3215,19 @@ GetCommandLogLevel(Node *parsetree)
 		case T_ExplainStmt:
 			{
 				ExplainStmt *stmt = (ExplainStmt *) parsetree;
-				bool		analyze = false;
+				bool		exec = false;
 				ListCell   *lc;
 
-				/* Look through an EXPLAIN ANALYZE to the contained stmt */
+				/* Look through an EXPLAIN EXEC to the contained stmt */
 				foreach(lc, stmt->options)
 				{
 					DefElem    *opt = (DefElem *) lfirst(lc);
 
-					if (strcmp(opt->defname, "analyze") == 0)
-						analyze = defGetBoolean(opt);
+					if (strcmp(opt->defname, "exec") == 0)
+						exec = defGetBoolean(opt);
 					/* don't "break", as explain.c will use the last value */
 				}
-				if (analyze)
+				if (exec)
 					return GetCommandLogLevel(stmt->query);
 
 				/* Plain EXPLAIN isn't so interesting */
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index eb4c8b5e79..72730fcfaf 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -52,7 +52,7 @@
  * mean that the plan can't queue any AFTER triggers; just that the caller
  * is responsible for there being a trigger context for them to be queued in.
  */
-#define EXEC_FLAG_EXPLAIN_ONLY	0x0001	/* EXPLAIN, no ANALYZE */
+#define EXEC_FLAG_EXPLAIN_ONLY	0x0001	/* EXPLAIN, no EXEC */
 #define EXEC_FLAG_REWIND		0x0002	/* need efficient rescan */
 #define EXEC_FLAG_BACKWARD		0x0004	/* need backward scan */
 #define EXEC_FLAG_MARK			0x0008	/* need mark/restore */
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 4b1635eb8b..6a92fb1d6f 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -2189,7 +2189,7 @@ typedef struct GatherMergeState
 } GatherMergeState;
 
 /* ----------------
- *	 Values displayed by EXPLAIN ANALYZE
+ *	 Values displayed by EXPLAIN EXEC
  * ----------------
  */
 typedef struct HashInstrumentation

--------------2.21.0--


