aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-04-10 15:56:15 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-04-10 15:56:15 -0300
commit15a8f8caad14c1f85b23d97842d0c27b106cc10e (patch)
tree764375ef544e9c6b7f61c8dcd8b6ba6549f97c97 /src/backend/commands/explain.c
parent1a40485af6e43be501500a88b1b9765cc0d69c0b (diff)
downloadpostgresql-15a8f8caad14c1f85b23d97842d0c27b106cc10e.tar.gz
postgresql-15a8f8caad14c1f85b23d97842d0c27b106cc10e.zip
Fix IndexOnlyScan counter for heap fetches in parallel mode
The HeapFetches counter was using a simple value in IndexOnlyScanState, which fails to propagate values from parallel workers; so the counts are wrong when IndexOnlyScan runs in parallel. Move it to Instrumentation, like all the other counters. While at it, change INSERT ON CONFLICT conflicting tuple counter to use the new ntuples2 instead of nfiltered2, which is a blatant misuse. Discussion: https://postgr.es/m/20180409215851.idwc75ct2bzi6tea@alvherre.pgsql
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r--src/backend/commands/explain.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 989b6aad67b..306e6444669 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -1459,12 +1459,8 @@ ExplainNode(PlanState *planstate, List *ancestors,
show_instrumentation_count("Rows Removed by Filter", 1,
planstate, es);
if (es->analyze)
- {
- long heapFetches =
- ((IndexOnlyScanState *) planstate)->ioss_HeapFetches;
-
- ExplainPropertyInteger("Heap Fetches", NULL, heapFetches, es);
- }
+ ExplainPropertyFloat("Heap Fetches", NULL,
+ planstate->instrument->ntuples2, 0, es);
break;
case T_BitmapIndexScan:
show_scan_qual(((BitmapIndexScan *) plan)->indexqualorig,
@@ -3132,7 +3128,7 @@ show_modifytable_info(ModifyTableState *mtstate, List *ancestors,
/* count the number of source rows */
total = mtstate->mt_plans[0]->instrument->ntuples;
- other_path = mtstate->ps.instrument->nfiltered2;
+ other_path = mtstate->ps.instrument->ntuples2;
insert_path = total - other_path;
ExplainPropertyFloat("Tuples Inserted", NULL,