pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Generate pg_stat_get*() functions for tables using macros
2+ messages / 1 participants
[nested] [flat]

* pgsql: Generate pg_stat_get*() functions for tables using macros
@ 2022-12-06 01:54 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2022-12-06 01:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Generate pg_stat_get*() functions for tables using macros

The same code pattern is repeated 17 times for int64 counters (0 for
missing entry) and 5 times for timestamps (NULL for missing entry) on
table entries.  This code is switched to use a macro for the basic code
instead, shaving a few hundred lines of originally-duplicated code.  The
function names remain the same, but some fields of PgStat_StatTabEntry
have to be renamed to cope with the new style.

Author: Bertrand Drouvot
Reviewed-by: Nathan Bossart
Discussion: https:/postgr.es/m/20221204173207.GA2669116@nathanxps13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/83a1a1b56645b7a55ec00e44f8018116ee87c720

Modified Files
--------------
src/backend/access/heap/README.HOT           |   2 +-
src/backend/postmaster/autovacuum.c          |   6 +-
src/backend/utils/activity/pgstat_relation.c |  50 +--
src/backend/utils/adt/pgstatfuncs.c          | 457 ++++++---------------------
src/include/pgstat.h                         |  20 +-
5 files changed, 139 insertions(+), 396 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Generate pg_stat_get*() functions for databases using macros
@ 2022-12-07 00:12 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2022-12-07 00:12 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Generate pg_stat_get*() functions for databases using macros

The same code pattern is repeated 21 times for int64 counters (0 for
missing entry) and 5 times for doubles (0 for missing entry) on database
entries.  This code is switched to use macros for the basic code
instead, shaving a few hundred lines of originally-duplicated code
patterns.  The function names remain the same, but some fields of
PgStat_StatDBEntry have to be renamed to cope with the new style.

This is in the same spirit as 83a1a1b.

Author: Michael Paquier
Reviewed-by: Nathan Bossart, Bertrand Drouvot
Discussion: https://postgr.es/m/Y46stlxQ2LQE20Na@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8018ffbf5895ee16a1fd7117c4526b47ac42332e

Modified Files
--------------
src/backend/utils/activity/pgstat_database.c |  94 +++---
src/backend/utils/activity/pgstat_relation.c |  14 +-
src/backend/utils/adt/pgstatfuncs.c          | 454 ++++++---------------------
src/include/pgstat.h                         |  54 ++--
4 files changed, 169 insertions(+), 447 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-12-07 00:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 01:54 pgsql: Generate pg_stat_get*() functions for tables using macros Michael Paquier <michael@paquier.xyz>
2022-12-07 00:12 pgsql: Generate pg_stat_get*() functions for databases using macros Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox