Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date
Msg-id CAA4eK1Ltqso42sQGCSWxr-V9x=Tmmn1pPD7ifWuSz8LvvbPA=w@mail.gmail.com
Whole thread Raw
In response to Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-hackers
On Thu, Apr 8, 2021 at 9:47 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> On Wed, Apr 07, 2021 at 02:12:11PM -0400, Bruce Momjian wrote:
> >
> > Patch applied.  I am ready to adjust this with any improvements people
> > might have.  Thank you for all the good feedback we got on this, and I
> > know many users have waited a long time for this feature.
>
> Thanks a lot Bruce and everyone!  I hope that the users who waited a long time
> for this will find everything they need.
>

@@ -1421,8 +1421,9 @@ ParallelQueryMain(dsm_segment *seg, shm_toc *toc)
    /* Setting debug_query_string for individual workers */
    debug_query_string = queryDesc->sourceText;

-   /* Report workers' query for monitoring purposes */
+   /* Report workers' query and queryId for monitoring purposes */
    pgstat_report_activity(STATE_RUNNING, debug_query_string);
+   pgstat_report_queryid(queryDesc->plannedstmt->queryId, false);


Below lines down in ParallelQueryMain, we call ExecutorStart which
will report queryid, so do we need it here?

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Next
From: Thomas Munro
Date:
Subject: Re: MultiXact\SLRU buffers configuration