summaryrefslogtreecommitdiff
path: root/src/include/replication/reorderbuffer.h
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2019-11-16 18:24:00 +0530
committerAmit Kapila <akapila@postgresql.org>2019-11-21 08:06:51 +0530
commit9290ad198b15d6b986b855d2a58d087a54777e87 (patch)
tree1758f43591a31c8b469434b8079b373872aae078 /src/include/replication/reorderbuffer.h
parent168d2064001f704965899bb2057591271c44e57a (diff)
Track statistics for spilling of changes from ReorderBuffer.
This adds the statistics about transactions spilled to disk from ReorderBuffer. Users can query the pg_stat_replication view to check these stats. Author: Tomas Vondra, with bug-fixes and minor changes by Dilip Kumar Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com
Diffstat (limited to 'src/include/replication/reorderbuffer.h')
-rw-r--r--src/include/replication/reorderbuffer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h
index 7c94d920fe9..0867ee9e636 100644
--- a/src/include/replication/reorderbuffer.h
+++ b/src/include/replication/reorderbuffer.h
@@ -402,6 +402,17 @@ struct ReorderBuffer
/* memory accounting */
Size size;
+
+ /*
+ * Statistics about transactions spilled to disk.
+ *
+ * A single transaction may be spilled repeatedly, which is why we keep
+ * two different counters. For spilling, the transaction counter includes
+ * both toplevel transactions and subtransactions.
+ */
+ int64 spillCount; /* spill-to-disk invocation counter */
+ int64 spillTxns; /* number of transactions spilled to disk */
+ int64 spillBytes; /* amount of data spilled to disk */
};