Re: Add sub-transaction overflow status in pg_stat_activity

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Amit Singh <amitksingh.mumbai@gmail.com>, Andres Freund <andres@anarazel.de>, Julien Rouhaud <rjuju123@gmail.com>, "Bossart, Nathan" <bossartn@amazon.com>, Dilip Kumar <dilipbalaut@gmail.com>, Ashutosh Sharma <ashu.coek88@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-11-14T17:29:58Z
Lists: pgsql-hackers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Nov 14, 2022 at 9:41 AM Robert Haas <robertmhaas@gmail.com> wrote:
>> The overhead of fetching the information is not large, but Justin is
>> concerned about the effect on the display width. I feel that's kind of
>> a lost cause because it's so wide already anyway, but I don't see a
>> reason why we need *two* new columns. Can't we get by with just one?
>> It could be overflowed true/false, or it could be the number of
>> subtransaction XIDs but with NULL instead if overflowed.

> NULL when overflowed seems like the opposite of the desired effect, calling
> attention to the exceptional status.  Make it a text column and write
> "overflow" or "###" as appropriate.  Anyone using the column is going to
> end up wanting to special-case overflow anyway and number-to-text
> conversion aside from overflow is simple enough if a number, and not just a
> display label, is needed.

I'd vote for just overflowed true/false.  Why do people need to know
the exact number of subtransactions?  (If there is a use-case, that
would definitely be material for an auxiliary function instead of a
view column.)

			regards, tom lane



Commits

  1. Fix comment that was missing a word.

  2. Expose some information about backend subxact status.