Generate pg_stat_get_xact*() functions with Macros
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-01-05T13:48:39Z
Lists: pgsql-hackers
Attachments
- v1-0001-generate-pg_stat_get_xact-functions-with-macros.patch (text/plain) patch v1-0001
Hi hackers, Please find attached a patch proposal to $SUBJECT. This is the same kind of work that has been done in 83a1a1b566 and 8018ffbf58 but this time for the pg_stat_get_xact*() functions (as suggested by Andres in [1]). The function names remain the same, but some fields have to be renamed. While at it, I also took the opportunity to create the macros for pg_stat_get_xact_function_total_time(), pg_stat_get_xact_function_self_time() and pg_stat_get_function_total_time(), pg_stat_get_function_self_time() (even if the same code pattern is only repeated two 2 times). Now that this patch renames some fields, I think that, for consistency, those ones should be renamed too (aka remove the f_ and t_ prefixes): PgStat_FunctionCounts.f_numcalls PgStat_StatFuncEntry.f_numcalls PgStat_TableCounts.t_truncdropped PgStat_TableCounts.t_delta_live_tuples PgStat_TableCounts.t_delta_dead_tuples PgStat_TableCounts.t_changed_tuples But I think it would be better to do it in a follow-up patch (once this one get committed). [1]: https://www.postgresql.org/message-id/20230105002733.ealhzubjaiqis6ua%40awork3.anarazel.de Looking forward to your feedback, Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
Generate a few more functions of pgstatfuncs.c with macros
- 4efd0bf7eaeb 16.0 landed
-
Generate pg_stat_get_xact*() functions for relations using macros
- 850f4b4c8cab 16.0 landed