public inbox for [email protected]
help / color / mirror / Atom feedFrom: Imseih (AWS), Sami <[email protected]>
To: Ian Lawrence Barwick <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: pg_stat_get_backend_subxact() and backend IDs?
Date: Fri, 25 Aug 2023 15:01:40 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAB8KJ=iWYvB1odjFRZybsPeUV8HUAiVVjY9RMHSdvWy1t77cLg@mail.gmail.com>
References: <CAB8KJ=j-ACb3H4L9a_b3ZG3iCYDW5aEu3WsPAzkm2S7JzS1Few@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CAB8KJ=iWYvB1odjFRZybsPeUV8HUAiVVjY9RMHSdvWy1t77cLg@mail.gmail.com>
I tested the patch and it does the correct thing.
I have a few comments:
1/ cast the return of bsearch. This was done previously and is the common
convention in the code.
So
+ return bsearch(&key, localBackendStatusTable, localNumBackends,
+ sizeof(LocalPgBackendStatus), cmp_lbestatus);
Should be
+ return (LocalPgBackendStatus *) bsearch(&key, localBackendStatusTable, localNumBackends,
+ sizeof(LocalPgBackendStatus), cmp_lbestatus);
2/ This will probably be a good time to update the docs for pg_stat_get_backend_subxact [1]
to call out that "subxact_count" will "only increase if a transaction is performing writes". Also to link
the reader to the subtransactions doc [2].
1. https://www.postgresql.org/docs/16/monitoring-stats.html#WAIT-EVENT-TIMEOUT-TABLE
2. https://www.postgresql.org/docs/16/subxacts.html
Regards,
Sami Imseih
Amazon Web Services (AWS)
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: pg_stat_get_backend_subxact() and backend IDs?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox