summaryrefslogtreecommitdiff
path: root/src/include/executor
diff options
context:
space:
mode:
authorFujii Masao2020-03-30 03:15:26 +0000
committerFujii Masao2020-03-30 03:15:26 +0000
commit4a539a25ebfc48329fd656a95f3c1eb2cda38af3 (patch)
treed4d503da2e6b3c1104961cb28ba0debef2f5b92a /src/include/executor
parentb61d161c146328ae6ba9ed937862d66e5c8b035a (diff)
Expose BufferUsageAccumDiff().
Previously pg_stat_statements calculated the difference of buffer counters by its own code even while BufferUsageAccumDiff() had the same code. This commit expose BufferUsageAccumDiff() and makes pg_stat_statements use it for the calculation, in order to simply the code. This change also would be useful for the upcoming patch for the planning counters in pg_stat_statements because the patch will add one more code for the calculation of difference of buffer counters and that can easily be done by using BufferUsageAccumDiff(). Author: Julien Rouhaud Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include/executor')
-rw-r--r--src/include/executor/instrument.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h
index f48d46aedef..3825a5ac1f3 100644
--- a/src/include/executor/instrument.h
+++ b/src/include/executor/instrument.h
@@ -81,5 +81,7 @@ extern void InstrAggNode(Instrumentation *dst, Instrumentation *add);
extern void InstrStartParallelQuery(void);
extern void InstrEndParallelQuery(BufferUsage *result);
extern void InstrAccumParallelQuery(BufferUsage *result);
+extern void BufferUsageAccumDiff(BufferUsage *dst,
+ const BufferUsage *add, const BufferUsage *sub);
#endif /* INSTRUMENT_H */