From 8912daf3bccbff719f8ebb03448e43281f67b28d Mon Sep 17 00:00:00 2001
From: Melanie Plageman <melanieplageman@gmail.com>
Date: Fri, 4 Nov 2022 15:48:10 -0400
Subject: [PATCH v4 2/4] Remove n/i/t_ prefixes from stats structs

---
 src/backend/access/heap/README.HOT           |  2 +-
 src/backend/postmaster/autovacuum.c          |  2 +-
 src/backend/utils/activity/pgstat_database.c | 16 ++---
 src/backend/utils/activity/pgstat_relation.c | 72 +++++++++----------
 src/backend/utils/adt/pgstatfuncs.c          | 42 +++++------
 src/include/pgstat.h                         | 76 ++++++++++----------
 6 files changed, 105 insertions(+), 105 deletions(-)

diff --git a/src/backend/access/heap/README.HOT b/src/backend/access/heap/README.HOT
index 68c6709aa8..6fd1767f70 100644
--- a/src/backend/access/heap/README.HOT
+++ b/src/backend/access/heap/README.HOT
@@ -271,7 +271,7 @@ physical tuple by eliminating an intermediate heap-only tuple or
 replacing a physical root tuple by a redirect pointer, a decrement in
 the table's number of dead tuples is reported to pgstats, which may
 postpone autovacuuming.  Note that we do not count replacing a root tuple
-by a DEAD line pointer as decrementing n_dead_tuples; we still want
+by a DEAD line pointer as decrementing dead_tuples; we still want
 autovacuum to run to clean up the index entries and DEAD item.
 
 This area probably needs further work ...
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 601834d4b4..2a295ce884 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -3081,7 +3081,7 @@ relation_needs_vacanalyze(Oid relid,
 	if (PointerIsValid(tabentry) && AutoVacuumingActive())
 	{
 		reltuples = classForm->reltuples;
-		vactuples = tabentry->n_dead_tuples;
+		vactuples = tabentry->dead_tuples;
 		instuples = tabentry->inserts_since_vacuum;
 		anltuples = tabentry->changes_since_analyze;
 
diff --git a/src/backend/utils/activity/pgstat_database.c b/src/backend/utils/activity/pgstat_database.c
index d9275611f0..ce8a9f4ac7 100644
--- a/src/backend/utils/activity/pgstat_database.c
+++ b/src/backend/utils/activity/pgstat_database.c
@@ -372,14 +372,14 @@ pgstat_database_flush_cb(PgStat_EntryRef *entry_ref, bool nowait)
 
 	PGSTAT_ACCUM_DBCOUNT(n_xact_commit);
 	PGSTAT_ACCUM_DBCOUNT(n_xact_rollback);
-	PGSTAT_ACCUM_DBCOUNT(n_blocks_fetched);
-	PGSTAT_ACCUM_DBCOUNT(n_blocks_hit);
-
-	PGSTAT_ACCUM_DBCOUNT(n_tuples_returned);
-	PGSTAT_ACCUM_DBCOUNT(n_tuples_fetched);
-	PGSTAT_ACCUM_DBCOUNT(n_tuples_inserted);
-	PGSTAT_ACCUM_DBCOUNT(n_tuples_updated);
-	PGSTAT_ACCUM_DBCOUNT(n_tuples_deleted);
+	PGSTAT_ACCUM_DBCOUNT(blocks_fetched);
+	PGSTAT_ACCUM_DBCOUNT(blocks_hit);
+
+	PGSTAT_ACCUM_DBCOUNT(tuples_returned);
+	PGSTAT_ACCUM_DBCOUNT(tuples_fetched);
+	PGSTAT_ACCUM_DBCOUNT(tuples_inserted);
+	PGSTAT_ACCUM_DBCOUNT(tuples_updated);
+	PGSTAT_ACCUM_DBCOUNT(tuples_deleted);
 
 	/* last_autovac_time is reported immediately */
 	Assert(pendingent->last_autovac_time == 0);
diff --git a/src/backend/utils/activity/pgstat_relation.c b/src/backend/utils/activity/pgstat_relation.c
index 13cdd7f849..94fbc6faea 100644
--- a/src/backend/utils/activity/pgstat_relation.c
+++ b/src/backend/utils/activity/pgstat_relation.c
@@ -294,8 +294,8 @@ pgstat_report_vacuum(Oid tableoid, bool shared,
 	shtabentry = (PgStatShared_Table *) entry_ref->shared_stats;
 	tabentry = &shtabentry->stats;
 
-	tabentry->n_live_tuples = livetuples;
-	tabentry->n_dead_tuples = deadtuples;
+	tabentry->live_tuples = livetuples;
+	tabentry->dead_tuples = deadtuples;
 
 	/*
 	 * It is quite possible that a non-aggressive VACUUM ended up skipping
@@ -365,7 +365,7 @@ pgstat_report_analyze(Relation rel,
 			deadtuples -= trans->tuples_updated + trans->tuples_deleted;
 		}
 		/* count stuff inserted by already-aborted subxacts, too */
-		deadtuples -= rel->pgstattab_info->t_counts.t_delta_dead_tuples;
+		deadtuples -= rel->pgstattab_info->t_counts.delta_dead_tuples;
 		/* Since ANALYZE's counts are estimates, we could have underflowed */
 		livetuples = Max(livetuples, 0);
 		deadtuples = Max(deadtuples, 0);
@@ -381,8 +381,8 @@ pgstat_report_analyze(Relation rel,
 	shtabentry = (PgStatShared_Table *) entry_ref->shared_stats;
 	tabentry = &shtabentry->stats;
 
-	tabentry->n_live_tuples = livetuples;
-	tabentry->n_dead_tuples = deadtuples;
+	tabentry->live_tuples = livetuples;
+	tabentry->dead_tuples = deadtuples;
 
 	/*
 	 * If commanded, reset changes_since_analyze to zero.  This forgets any
@@ -434,9 +434,9 @@ pgstat_count_heap_update(Relation rel, bool hot)
 		ensure_tabstat_xact_level(pgstattab_info);
 		pgstattab_info->trans->tuples_updated++;
 
-		/* t_tuples_hot_updated is nontransactional, so just advance it */
+		/* tuples_hot_updated is nontransactional, so just advance it */
 		if (hot)
-			pgstattab_info->t_counts.t_tuples_hot_updated++;
+			pgstattab_info->t_counts.tuples_hot_updated++;
 	}
 }
 
@@ -477,7 +477,7 @@ pgstat_count_truncate(Relation rel)
  * update dead-tuples count
  *
  * The semantics of this are that we are reporting the nontransactional
- * recovery of "delta" dead tuples; so t_delta_dead_tuples decreases
+ * recovery of "delta" dead tuples; so delta_dead_tuples decreases
  * rather than increasing, and the change goes straight into the per-table
  * counter, not into transactional state.
  */
@@ -488,7 +488,7 @@ pgstat_update_heap_dead_tuples(Relation rel, int delta)
 	{
 		PgStat_TableStatus *pgstattab_info = rel->pgstattab_info;
 
-		pgstattab_info->t_counts.t_delta_dead_tuples -= delta;
+		pgstattab_info->t_counts.delta_dead_tuples -= delta;
 	}
 }
 
@@ -631,33 +631,33 @@ AtEOXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit)
 		if (!isCommit)
 			restore_truncdrop_counters(trans);
 		/* count attempted actions regardless of commit/abort */
-		tabstat->t_counts.t_tuples_inserted += trans->tuples_inserted;
-		tabstat->t_counts.t_tuples_updated += trans->tuples_updated;
-		tabstat->t_counts.t_tuples_deleted += trans->tuples_deleted;
+		tabstat->t_counts.tuples_inserted += trans->tuples_inserted;
+		tabstat->t_counts.tuples_updated += trans->tuples_updated;
+		tabstat->t_counts.tuples_deleted += trans->tuples_deleted;
 		if (isCommit)
 		{
-			tabstat->t_counts.t_truncdropped = trans->truncdropped;
+			tabstat->t_counts.truncdropped = trans->truncdropped;
 			if (trans->truncdropped)
 			{
 				/* forget live/dead stats seen by backend thus far */
-				tabstat->t_counts.t_delta_live_tuples = 0;
-				tabstat->t_counts.t_delta_dead_tuples = 0;
+				tabstat->t_counts.delta_live_tuples = 0;
+				tabstat->t_counts.delta_dead_tuples = 0;
 			}
 			/* insert adds a live tuple, delete removes one */
-			tabstat->t_counts.t_delta_live_tuples +=
+			tabstat->t_counts.delta_live_tuples +=
 				trans->tuples_inserted - trans->tuples_deleted;
 			/* update and delete each create a dead tuple */
-			tabstat->t_counts.t_delta_dead_tuples +=
+			tabstat->t_counts.delta_dead_tuples +=
 				trans->tuples_updated + trans->tuples_deleted;
 			/* insert, update, delete each count as one change event */
-			tabstat->t_counts.t_changed_tuples +=
+			tabstat->t_counts.changed_tuples +=
 				trans->tuples_inserted + trans->tuples_updated +
 				trans->tuples_deleted;
 		}
 		else
 		{
 			/* inserted tuples are dead, deleted tuples are unaffected */
-			tabstat->t_counts.t_delta_dead_tuples +=
+			tabstat->t_counts.delta_dead_tuples +=
 				trans->tuples_inserted + trans->tuples_updated;
 			/* an aborted xact generates no changed_tuple events */
 		}
@@ -737,11 +737,11 @@ AtEOSubXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit, in
 			/* first restore values obliterated by truncate/drop */
 			restore_truncdrop_counters(trans);
 			/* count attempted actions regardless of commit/abort */
-			tabstat->t_counts.t_tuples_inserted += trans->tuples_inserted;
-			tabstat->t_counts.t_tuples_updated += trans->tuples_updated;
-			tabstat->t_counts.t_tuples_deleted += trans->tuples_deleted;
+			tabstat->t_counts.tuples_inserted += trans->tuples_inserted;
+			tabstat->t_counts.tuples_updated += trans->tuples_updated;
+			tabstat->t_counts.tuples_deleted += trans->tuples_deleted;
 			/* inserted tuples are dead, deleted tuples are unaffected */
-			tabstat->t_counts.t_delta_dead_tuples +=
+			tabstat->t_counts.delta_dead_tuples +=
 				trans->tuples_inserted + trans->tuples_updated;
 			tabstat->trans = trans->upper;
 			pfree(trans);
@@ -821,21 +821,21 @@ pgstat_twophase_postcommit(TransactionId xid, uint16 info,
 	pgstattab_info = pgstat_prep_table_pending(rec->t_id, rec->t_shared);
 
 	/* Same math as in AtEOXact_PgStat, commit case */
-	pgstattab_info->t_counts.t_tuples_inserted += rec->tuples_inserted;
-	pgstattab_info->t_counts.t_tuples_updated += rec->tuples_updated;
-	pgstattab_info->t_counts.t_tuples_deleted += rec->tuples_deleted;
-	pgstattab_info->t_counts.t_truncdropped = rec->t_truncdropped;
+	pgstattab_info->t_counts.tuples_inserted += rec->tuples_inserted;
+	pgstattab_info->t_counts.tuples_updated += rec->tuples_updated;
+	pgstattab_info->t_counts.tuples_deleted += rec->tuples_deleted;
+	pgstattab_info->t_counts.truncdropped = rec->t_truncdropped;
 	if (rec->t_truncdropped)
 	{
 		/* forget live/dead stats seen by backend thus far */
-		pgstattab_info->t_counts.t_delta_live_tuples = 0;
-		pgstattab_info->t_counts.t_delta_dead_tuples = 0;
+		pgstattab_info->t_counts.delta_live_tuples = 0;
+		pgstattab_info->t_counts.delta_dead_tuples = 0;
 	}
-	pgstattab_info->t_counts.t_delta_live_tuples +=
+	pgstattab_info->t_counts.delta_live_tuples +=
 		rec->tuples_inserted - rec->tuples_deleted;
-	pgstattab_info->t_counts.t_delta_dead_tuples +=
+	pgstattab_info->t_counts.delta_dead_tuples +=
 		rec->tuples_updated + rec->tuples_deleted;
-	pgstattab_info->t_counts.t_changed_tuples +=
+	pgstattab_info->t_counts.changed_tuples +=
 		rec->tuples_inserted + rec->tuples_updated +
 		rec->tuples_deleted;
 }
@@ -863,10 +863,10 @@ pgstat_twophase_postabort(TransactionId xid, uint16 info,
 		rec->tuples_updated = rec->updated_pre_truncdrop;
 		rec->tuples_deleted = rec->deleted_pre_truncdrop;
 	}
-	pgstattab_info->t_counts.t_tuples_inserted += rec->tuples_inserted;
-	pgstattab_info->t_counts.t_tuples_updated += rec->tuples_updated;
-	pgstattab_info->t_counts.t_tuples_deleted += rec->tuples_deleted;
-	pgstattab_info->t_counts.t_delta_dead_tuples +=
+	pgstattab_info->t_counts.tuples_inserted += rec->tuples_inserted;
+	pgstattab_info->t_counts.tuples_updated += rec->tuples_updated;
+	pgstattab_info->t_counts.tuples_deleted += rec->tuples_deleted;
+	pgstattab_info->t_counts.delta_dead_tuples +=
 		rec->tuples_inserted + rec->tuples_updated;
 }
 
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 0dd6148ed1..17e044b90a 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -193,7 +193,7 @@ pg_stat_get_live_tuples(PG_FUNCTION_ARGS)
 	int64		result;
 	PgStat_StatTabEntry *tabentry = pgstat_fetch_stat_tabentry(relid);
 
-	result = PGSTAT_FETCH_STAT_ENTRY(tabentry, n_live_tuples);
+	result = PGSTAT_FETCH_STAT_ENTRY(tabentry, live_tuples);
 
 	PG_RETURN_INT64(result);
 }
@@ -206,7 +206,7 @@ pg_stat_get_dead_tuples(PG_FUNCTION_ARGS)
 	int64		result;
 	PgStat_StatTabEntry *tabentry = pgstat_fetch_stat_tabentry(relid);
 
-	result = PGSTAT_FETCH_STAT_ENTRY(tabentry, n_dead_tuples);
+	result = PGSTAT_FETCH_STAT_ENTRY(tabentry, dead_tuples);
 
 	PG_RETURN_INT64(result);
 }
@@ -1249,7 +1249,7 @@ pg_stat_get_db_blocks_fetched(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_blocks_fetched);
+		result = (int64) (dbentry->blocks_fetched);
 
 	PG_RETURN_INT64(result);
 }
@@ -1265,7 +1265,7 @@ pg_stat_get_db_blocks_hit(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_blocks_hit);
+		result = (int64) (dbentry->blocks_hit);
 
 	PG_RETURN_INT64(result);
 }
@@ -1281,7 +1281,7 @@ pg_stat_get_db_tuples_returned(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_tuples_returned);
+		result = (int64) (dbentry->tuples_returned);
 
 	PG_RETURN_INT64(result);
 }
@@ -1297,7 +1297,7 @@ pg_stat_get_db_tuples_fetched(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_tuples_fetched);
+		result = (int64) (dbentry->tuples_fetched);
 
 	PG_RETURN_INT64(result);
 }
@@ -1313,7 +1313,7 @@ pg_stat_get_db_tuples_inserted(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_tuples_inserted);
+		result = (int64) (dbentry->tuples_inserted);
 
 	PG_RETURN_INT64(result);
 }
@@ -1329,7 +1329,7 @@ pg_stat_get_db_tuples_updated(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_tuples_updated);
+		result = (int64) (dbentry->tuples_updated);
 
 	PG_RETURN_INT64(result);
 }
@@ -1345,7 +1345,7 @@ pg_stat_get_db_tuples_deleted(PG_FUNCTION_ARGS)
 	if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (dbentry->n_tuples_deleted);
+		result = (int64) (dbentry->tuples_deleted);
 
 	PG_RETURN_INT64(result);
 }
@@ -1864,7 +1864,7 @@ pg_stat_get_table_xact_numscans(PG_FUNCTION_ARGS)
 	if ((tabentry = find_tabstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (tabentry->t_counts.t_numscans);
+		result = (int64) (tabentry->t_counts.numscans);
 
 	PG_RETURN_INT64(result);
 }
@@ -1879,7 +1879,7 @@ pg_stat_get_index_xact_numscans(PG_FUNCTION_ARGS)
 	if ((indentry = find_indstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (indentry->i_counts.i_numscans);
+		result = (int64) (indentry->i_counts.numscans);
 
 	PG_RETURN_INT64(result);
 }
@@ -1894,7 +1894,7 @@ pg_stat_get_xact_tuples_returned(PG_FUNCTION_ARGS)
 	if ((indentry = find_indstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (indentry->i_counts.i_tuples_returned);
+		result = (int64) (indentry->i_counts.tuples_returned);
 
 	PG_RETURN_INT64(result);
 }
@@ -1909,7 +1909,7 @@ pg_stat_get_xact_tuples_fetched(PG_FUNCTION_ARGS)
 	if ((indentry = find_indstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (indentry->i_counts.i_tuples_fetched);
+		result = (int64) (indentry->i_counts.tuples_fetched);
 
 	PG_RETURN_INT64(result);
 }
@@ -1926,8 +1926,8 @@ pg_stat_get_xact_tuples_inserted(PG_FUNCTION_ARGS)
 		result = 0;
 	else
 	{
-		result = tabentry->t_counts.t_tuples_inserted;
-		/* live subtransactions' counts aren't in t_tuples_inserted yet */
+		result = tabentry->t_counts.tuples_inserted;
+		/* live subtransactions' counts aren't in tuples_inserted yet */
 		for (trans = tabentry->trans; trans != NULL; trans = trans->upper)
 			result += trans->tuples_inserted;
 	}
@@ -1947,8 +1947,8 @@ pg_stat_get_xact_tuples_updated(PG_FUNCTION_ARGS)
 		result = 0;
 	else
 	{
-		result = tabentry->t_counts.t_tuples_updated;
-		/* live subtransactions' counts aren't in t_tuples_updated yet */
+		result = tabentry->t_counts.tuples_updated;
+		/* live subtransactions' counts aren't in tuples_updated yet */
 		for (trans = tabentry->trans; trans != NULL; trans = trans->upper)
 			result += trans->tuples_updated;
 	}
@@ -1968,7 +1968,7 @@ pg_stat_get_xact_tuples_deleted(PG_FUNCTION_ARGS)
 		result = 0;
 	else
 	{
-		result = tabentry->t_counts.t_tuples_deleted;
+		result = tabentry->t_counts.tuples_deleted;
 		/* live subtransactions' counts aren't in t_tuples_deleted yet */
 		for (trans = tabentry->trans; trans != NULL; trans = trans->upper)
 			result += trans->tuples_deleted;
@@ -1987,7 +1987,7 @@ pg_stat_get_xact_tuples_hot_updated(PG_FUNCTION_ARGS)
 	if ((tabentry = find_tabstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (tabentry->t_counts.t_tuples_hot_updated);
+		result = (int64) (tabentry->t_counts.tuples_hot_updated);
 
 	PG_RETURN_INT64(result);
 }
@@ -2002,7 +2002,7 @@ pg_stat_get_xact_blocks_fetched(PG_FUNCTION_ARGS)
 	if ((indentry = find_indstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (indentry->i_counts.i_blocks_fetched);
+		result = (int64) (indentry->i_counts.blocks_fetched);
 
 	PG_RETURN_INT64(result);
 }
@@ -2017,7 +2017,7 @@ pg_stat_get_xact_blocks_hit(PG_FUNCTION_ARGS)
 	if ((indentry = find_indstat_entry(relid)) == NULL)
 		result = 0;
 	else
-		result = (int64) (indentry->i_counts.i_blocks_hit);
+		result = (int64) (indentry->i_counts.blocks_hit);
 
 	PG_RETURN_INT64(result);
 }
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 8dae39b917..4ec00afc46 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -160,12 +160,12 @@ typedef struct PgStat_BackendSubEntry
  */
 typedef struct PgStat_IndexCounts
 {
-	PgStat_Counter i_numscans;
+	PgStat_Counter numscans;
 
-	PgStat_Counter i_tuples_returned;
-	PgStat_Counter i_tuples_fetched;
-	PgStat_Counter i_blocks_fetched;
-	PgStat_Counter i_blocks_hit;
+	PgStat_Counter tuples_returned;
+	PgStat_Counter tuples_fetched;
+	PgStat_Counter blocks_fetched;
+	PgStat_Counter blocks_hit;
 } PgStat_IndexCounts;
 
 /* ----------
@@ -187,23 +187,23 @@ typedef struct PgStat_IndexCounts
  */
 typedef struct PgStat_TableCounts
 {
-	PgStat_Counter t_numscans;
+	PgStat_Counter numscans;
 
-	PgStat_Counter t_tuples_returned;
-	PgStat_Counter t_tuples_fetched;
+	PgStat_Counter tuples_returned;
+	PgStat_Counter tuples_fetched;
 
-	PgStat_Counter t_tuples_inserted;
-	PgStat_Counter t_tuples_updated;
-	PgStat_Counter t_tuples_deleted;
-	PgStat_Counter t_tuples_hot_updated;
-	bool		t_truncdropped;
+	PgStat_Counter tuples_inserted;
+	PgStat_Counter tuples_updated;
+	PgStat_Counter tuples_deleted;
+	PgStat_Counter tuples_hot_updated;
+	bool		truncdropped;
 
-	PgStat_Counter t_delta_live_tuples;
-	PgStat_Counter t_delta_dead_tuples;
-	PgStat_Counter t_changed_tuples;
+	PgStat_Counter delta_live_tuples;
+	PgStat_Counter delta_dead_tuples;
+	PgStat_Counter changed_tuples;
 
-	PgStat_Counter t_blocks_fetched;
-	PgStat_Counter t_blocks_hit;
+	PgStat_Counter blocks_fetched;
+	PgStat_Counter blocks_hit;
 } PgStat_TableCounts;
 
 /* ----------
@@ -316,14 +316,14 @@ typedef struct PgStat_StatDBEntry
 {
 	PgStat_Counter n_xact_commit;
 	PgStat_Counter n_xact_rollback;
-	PgStat_Counter n_blocks_fetched;
-	PgStat_Counter n_blocks_hit;
-	PgStat_Counter n_tuples_returned;
-	PgStat_Counter n_tuples_fetched;
-	PgStat_Counter n_tuples_inserted;
-	PgStat_Counter n_tuples_updated;
-	PgStat_Counter n_tuples_deleted;
-	TimestampTz last_autovac_time;
+	PgStat_Counter blocks_fetched;
+	PgStat_Counter blocks_hit;
+	PgStat_Counter tuples_returned;
+	PgStat_Counter tuples_fetched;
+	PgStat_Counter tuples_inserted;
+	PgStat_Counter tuples_updated;
+	PgStat_Counter tuples_deleted;
+	TimestampTz    last_autovac_time;
 	PgStat_Counter n_conflict_tablespace;
 	PgStat_Counter n_conflict_lock;
 	PgStat_Counter n_conflict_snapshot;
@@ -400,8 +400,8 @@ typedef struct PgStat_StatTabEntry
 	PgStat_Counter tuples_deleted;
 	PgStat_Counter tuples_hot_updated;
 
-	PgStat_Counter n_live_tuples;
-	PgStat_Counter n_dead_tuples;
+	PgStat_Counter live_tuples;
+	PgStat_Counter dead_tuples;
 	PgStat_Counter changes_since_analyze;
 	PgStat_Counter inserts_since_vacuum;
 
@@ -580,52 +580,52 @@ extern void pgstat_report_analyze(Relation rel,
 #define pgstat_count_heap_scan(rel)									\
 	do {															\
 		if (pgstat_should_count_table(rel))						\
-			(rel)->pgstattab_info->t_counts.t_numscans++;				\
+			(rel)->pgstattab_info->t_counts.numscans++;				\
 	} while (0)
 #define pgstat_count_heap_getnext(rel)								\
 	do {															\
 		if (pgstat_should_count_table(rel))						\
-			(rel)->pgstattab_info->t_counts.t_tuples_returned++;		\
+			(rel)->pgstattab_info->t_counts.tuples_returned++;		\
 	} while (0)
 #define pgstat_count_heap_fetch(rel)								\
 	do {															\
 		if (pgstat_should_count_table(rel))						\
-			(rel)->pgstattab_info->t_counts.t_tuples_fetched++;		\
+			(rel)->pgstattab_info->t_counts.tuples_fetched++;		\
 	} while (0)
 #define pgstat_count_index_fetch(rel)								\
 	do {															\
 		if (pgstat_should_count_index(rel))						\
-			(rel)->pgstatind_info->i_counts.i_tuples_fetched++;		\
+			(rel)->pgstatind_info->i_counts.tuples_fetched++;		\
 	} while (0)
 #define pgstat_count_index_scan(rel)								\
 	do {															\
 		if (pgstat_should_count_index(rel))						\
-			(rel)->pgstatind_info->i_counts.i_numscans++;			\
+			(rel)->pgstatind_info->i_counts.numscans++;			\
 	} while (0)
 #define pgstat_count_index_tuples(rel, n)							\
 	do {															\
 		if (pgstat_should_count_index(rel))						\
-			(rel)->pgstatind_info->i_counts.i_tuples_returned += (n);	\
+			(rel)->pgstatind_info->i_counts.tuples_returned += (n);	\
 	} while (0)
 #define pgstat_count_table_buffer_read(rel)								\
 	do {															\
 		if (pgstat_should_count_table(rel))	\
-			(rel)->pgstattab_info->t_counts.t_blocks_fetched++;		\
+			(rel)->pgstattab_info->t_counts.blocks_fetched++;		\
 	} while (0)
 #define pgstat_count_index_buffer_read(rel)								\
 	do {															\
 		if (pgstat_should_count_index(rel))	\
-			(rel)->pgstatind_info->i_counts.i_blocks_fetched++;		\
+			(rel)->pgstatind_info->i_counts.blocks_fetched++;		\
 	} while (0)
 #define pgstat_count_table_buffer_hit(rel)								\
 	do {															\
 		if (pgstat_should_count_table(rel))	\
-			(rel)->pgstattab_info->t_counts.t_blocks_hit++; \
+			(rel)->pgstattab_info->t_counts.blocks_hit++; \
 	} while (0)
 #define pgstat_count_index_buffer_hit(rel)								\
 	do {															\
 		if (pgstat_should_count_index(rel))	\
-			(rel)->pgstatind_info->i_counts.i_blocks_hit++; \
+			(rel)->pgstatind_info->i_counts.blocks_hit++; \
 	} while (0)
 extern void pgstat_count_heap_insert(Relation rel, PgStat_Counter n);
 extern void pgstat_count_heap_update(Relation rel, bool hot);
-- 
2.34.1

