Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Yun Li <liyunjuanyong(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date: 2019-03-19 14:51:37
Message-ID: CAOBaU_YsiPHJ-mm26omMY7hgBBXfx9Ld0xw-DWrdvpbBKpbqQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 18, 2019 at 7:33 PM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:
>
> On Mon, Mar 18, 2019 at 6:23 PM Yun Li <liyunjuanyong(at)gmail(dot)com> wrote:
> >
> > Let's take one step back. Since queryId is stored in core as Julien pointed out, can we just add that global to the pg_stat_get_activity and ultimately exposed in pg_stat_activity view? Then no matter whether PGSS is on or off, or however the customer extensions are updating that filed, we expose that field in that view then enable user to leverage that id to join with pgss or their extension. Will this sounds a good idea?
>
> I'd greatly welcome expose queryid exposure in pg_stat_activity, and
> also in log_line_prefix. I'm afraid that it's too late for pg12
> inclusion, but I'll be happy to provide a patch for that for pg13.

Here's a prototype patch for queryid exposure in pg_stat_activity and
log_line prefix.

Attachment Content-Type Size
queryid_exposure-v1.diff text/x-patch 17.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thibaut Madelaine 2019-03-19 14:58:57 Re: Problem with default partition pruning
Previous Message Julien Rouhaud 2019-03-19 14:43:31 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?