From 507a0d00ff82b7ad356d7565a60024bd38292d46 Mon Sep 17 00:00:00 2001
From: Melanie Plageman <melanieplageman@gmail.com>
Date: Fri, 4 Nov 2022 16:24:30 -0400
Subject: [PATCH v4 3/4] reorder members

---
 src/include/pgstat.h | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 4ec00afc46..eda3540561 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -146,6 +146,13 @@ typedef struct PgStat_BackendSubEntry
 	PgStat_Counter sync_error_count;
 } PgStat_BackendSubEntry;
 
+#define PgStat_RelationCounts \
+	PgStat_Counter numscans; \
+	PgStat_Counter tuples_returned; \
+	PgStat_Counter tuples_fetched; \
+	PgStat_Counter blocks_fetched; \
+	PgStat_Counter blocks_hit;
+
 /* ----------
  * PgStat_IndexCounts			The actual per-index counts kept by a backend
  *
@@ -160,12 +167,7 @@ typedef struct PgStat_BackendSubEntry
  */
 typedef struct PgStat_IndexCounts
 {
-	PgStat_Counter numscans;
-
-	PgStat_Counter tuples_returned;
-	PgStat_Counter tuples_fetched;
-	PgStat_Counter blocks_fetched;
-	PgStat_Counter blocks_hit;
+	PgStat_RelationCounts
 } PgStat_IndexCounts;
 
 /* ----------
@@ -187,10 +189,7 @@ typedef struct PgStat_IndexCounts
  */
 typedef struct PgStat_TableCounts
 {
-	PgStat_Counter numscans;
-
-	PgStat_Counter tuples_returned;
-	PgStat_Counter tuples_fetched;
+	PgStat_RelationCounts
 
 	PgStat_Counter tuples_inserted;
 	PgStat_Counter tuples_updated;
@@ -202,8 +201,6 @@ typedef struct PgStat_TableCounts
 	PgStat_Counter delta_dead_tuples;
 	PgStat_Counter changed_tuples;
 
-	PgStat_Counter blocks_fetched;
-	PgStat_Counter blocks_hit;
 } PgStat_TableCounts;
 
 /* ----------
-- 
2.34.1

