diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-04-15 11:49:41 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-04-15 11:52:18 -0400 |
commit | 5702277ca97396384eaf5c58d582b79b9984ce73 (patch) | |
tree | e518f6d5bcc8a1f7c57d49eaaa05530cf91752c7 /src/backend/commands/explain.c | |
parent | 6b85d4ba9b09dc94cf1b14aef517da095a83cdbb (diff) | |
download | postgresql-5702277ca97396384eaf5c58d582b79b9984ce73.tar.gz postgresql-5702277ca97396384eaf5c58d582b79b9984ce73.zip |
Tweak EXPLAIN for parallel query to show workers launched.
The previous display was sort of confusing, because it didn't
distinguish between the number of workers that we planned to launch
and the number that actually got launched. This has already confused
several people, so display both numbers and label them clearly.
Julien Rouhaud, reviewed by me.
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 713cd0e3da8..379fc5c429e 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -1339,8 +1339,16 @@ ExplainNode(PlanState *planstate, List *ancestors, if (plan->qual) show_instrumentation_count("Rows Removed by Filter", 1, planstate, es); - ExplainPropertyInteger("Number of Workers", + ExplainPropertyInteger("Workers Planned", gather->num_workers, es); + if (es->analyze) + { + int nworkers; + + nworkers = ((GatherState *) planstate)->nworkers_launched; + ExplainPropertyInteger("Workers Launched", + nworkers, es); + } if (gather->single_copy) ExplainPropertyText("Single Copy", gather->single_copy ? "true" : "false", |