Re: Generate pg_stat_get_xact*() functions with Macros

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "Gregory Stark (as CFM)" <stark(dot)cfm(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Generate pg_stat_get_xact*() functions with Macros
Date: 2023-03-24 05:58:30
Message-ID: 631e3084-c5d9-8463-7540-fcff4674caa5@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 3/24/23 1:04 AM, Michael Paquier wrote:
> On Thu, Mar 02, 2023 at 08:39:14AM +0100, Drouvot, Bertrand wrote:
>> Yeah, there is some dependencies around this one.
>>
>> [1]: depends on it
>> Current one depends of [2], [3] and [4]
>>
>> Waiting on Author is then the right state, thanks for having moved it to that state.
>>
>> [1]: https://www.postgresql.org/message-id/flat/f572abe7-a1bb-e13b-48c7-2ca150546822(at)gmail(dot)com
>> [2]: https://www.postgresql.org/message-id/flat/b9e1f543-ee93-8168-d530-d961708ad9d3(at)gmail(dot)com
>> [3]: https://www.postgresql.org/message-id/flat/11d531fe-52fc-c6ea-7e8e-62f1b6ec626e(at)gmail(dot)com
>> [4]: https://www.postgresql.org/message-id/flat/9142f62a-a422-145c-bde0-b5bc498a4ada(at)gmail(dot)com
>
> [3] and [4] have been applied.

Thanks for your help on this!

> [2] is more sensitive than it looks,
> and [1] for the split of index and table stats can feed on the one of
> this thread.
>
> Roma wasn't built in one day, and from what I can see you can still do
> some progress with the refactoring of pgstatfuncs.c with what's
> already on HEAD. So how about handling doing that first as much as we
> can based on the state of HEAD? That looks like 50~60% (?) of the
> original goal to switch pgstatfuncs.c to use more macros to generate
> the definition of all these SQL functions.

I think that's a good idea, so please find enclosed V2 which as compare to V1:

- Does not include the refactoring for pg_stat_get_xact_tuples_inserted(), pg_stat_get_xact_tuples_updated()
and pg_stat_get_xact_tuples_deleted() (as they depend of [2] mentioned above)

- Does not include the refactoring for pg_stat_get_xact_function_total_time(), pg_stat_get_xact_function_self_time(),
pg_stat_get_function_total_time() and pg_stat_get_function_self_time(). I think they can be done in a dedicated commit once
we agree on the renaming for PG_STAT_GET_DBENTRY_FLOAT8 (see Andres's comment up-thread) so that the new macros can match the future agreement.

- Does include the refactoring of the new pg_stat_get_xact_tuples_newpage_updated() function (added in ae4fdde135)

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v2-0001-generate-pg_stat_get_xact-functions-with-macros.patch text/plain 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brar Piening 2023-03-24 05:59:33 Re: doc: add missing "id" attributes to extension packaging page
Previous Message Brar Piening 2023-03-24 05:48:17 Re: doc: add missing "id" attributes to extension packaging page