pgqs_ExecutorEnd gets called before regular ExecutorEnd, which means the instrumentation may not be finalized - there may still be data from the last loop in some of the nodes. pgqs_collectNodeStats needs to do something like this:
if (planstate->instrument)
InstrEndLoop(planstate->instrument);
pgqs_ExecutorEnd gets called before regular ExecutorEnd, which means the instrumentation may not be finalized - there may still be data from the last loop in some of the nodes. pgqs_collectNodeStats needs to do something like this:
similarly to ExplainNode().