1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

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
This commit is contained in:
Alvaro Herrera
2018-04-10 15:56:15 -03:00
parent 1a40485af6
commit 15a8f8caad
6 changed files with 13 additions and 13 deletions

View File

@ -461,7 +461,7 @@ ExecInsert(ModifyTableState *mtstate,
&conflictTid, planSlot, slot,
estate, canSetTag, &returning))
{
InstrCountFiltered2(&mtstate->ps, 1);
InstrCountTuples2(&mtstate->ps, 1);
return returning;
}
else
@ -476,7 +476,7 @@ ExecInsert(ModifyTableState *mtstate,
*/
Assert(onconflict == ONCONFLICT_NOTHING);
ExecCheckTIDVisible(estate, resultRelInfo, &conflictTid);
InstrCountFiltered2(&mtstate->ps, 1);
InstrCountTuples2(&mtstate->ps, 1);
return NULL;
}
}