git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 79f7c48) | patch
Generate pg_stat_get*() functions for databases using macros
Wed, 7 Dec 2022 00:11:48 +0000 (09:11 +0900)
Wed, 7 Dec 2022 00:11:48 +0000 (09:11 +0900)
commit 8018ffbf5895ee16a1fd7117c4526b47ac42332e
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
src/backend/utils/activity/pgstat_database.c diff | blob | blame | history
src/backend/utils/activity/pgstat_relation.c diff | blob | blame | history
src/backend/utils/adt/pgstatfuncs.c diff | blob | blame | history
src/include/pgstat.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /