mirror of
https://github.com/postgres/postgres.git
synced 2026-02-03 20:40:14 -05:00
When a Gather or Gather Merge node is started and stopped multiple
times, accumulate instrumentation data only once, at the end, instead
of after each execution, to avoid recording inflated totals.
Commit 778e78ae9f, the previous attempt
at a fix, instead reset the state after every execution, which worked
for the general instrumentation data but had problems for the additional
instrumentation specific to Sort and Hash nodes.
Report by hubert depesz lubaczewski. Analysis and fix by Amit Kapila,
following a design proposal from Thomas Munro, with a comment tweak
by me.
Discussion: http://postgr.es/m/20171127175631.GA405@depesz.com
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* nodeSort.h
|
|
*
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/executor/nodeSort.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef NODESORT_H
|
|
#define NODESORT_H
|
|
|
|
#include "access/parallel.h"
|
|
#include "nodes/execnodes.h"
|
|
|
|
extern SortState *ExecInitSort(Sort *node, EState *estate, int eflags);
|
|
extern void ExecEndSort(SortState *node);
|
|
extern void ExecSortMarkPos(SortState *node);
|
|
extern void ExecSortRestrPos(SortState *node);
|
|
extern void ExecReScanSort(SortState *node);
|
|
|
|
/* parallel instrumentation support */
|
|
extern void ExecSortEstimate(SortState *node, ParallelContext *pcxt);
|
|
extern void ExecSortInitializeDSM(SortState *node, ParallelContext *pcxt);
|
|
extern void ExecSortInitializeWorker(SortState *node, ParallelWorkerContext *pwcxt);
|
|
extern void ExecSortRetrieveInstrumentation(SortState *node);
|
|
|
|
#endif /* NODESORT_H */
|