diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-04-10 15:56:15 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-04-10 15:56:15 -0300 |
commit | 15a8f8caad14c1f85b23d97842d0c27b106cc10e (patch) | |
tree | 764375ef544e9c6b7f61c8dcd8b6ba6549f97c97 /src/include/nodes/execnodes.h | |
parent | 1a40485af6e43be501500a88b1b9765cc0d69c0b (diff) |
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/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 06456f07cc7..deab8754663 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -1004,6 +1004,11 @@ typedef struct PlanState #define outerPlanState(node) (((PlanState *)(node))->lefttree) /* Macros for inline access to certain instrumentation counters */ +#define InstrCountTuples2(node, delta) \ + do { \ + if (((PlanState *)(node))->instrument) \ + ((PlanState *)(node))->instrument->ntuples2 += (delta); \ + } while (0) #define InstrCountFiltered1(node, delta) \ do { \ if (((PlanState *)(node))->instrument) \ @@ -1368,7 +1373,6 @@ typedef struct IndexScanState * RelationDesc index relation descriptor * ScanDesc index scan descriptor * VMBuffer buffer in use for visibility map testing, if any - * HeapFetches number of tuples we were forced to fetch from heap * ioss_PscanLen Size of parallel index-only scan descriptor * ---------------- */ @@ -1387,7 +1391,6 @@ typedef struct IndexOnlyScanState Relation ioss_RelationDesc; IndexScanDesc ioss_ScanDesc; Buffer ioss_VMBuffer; - long ioss_HeapFetches; Size ioss_PscanLen; } IndexOnlyScanState; |