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

From Bruce Momjian
Subject Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date
Msg-id 20210408151700.GB2439@momjian.us
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>)
List pgsql-hackers
On Thu, Apr  8, 2021 at 09:31:27PM +0800, Julien Rouhaud wrote:
> On Thu, Apr 08, 2021 at 08:27:20PM +0800, Julien Rouhaud wrote:
> > On Thu, Apr 08, 2021 at 05:46:07PM +0530, Amit Kapila wrote:
> > > 
> > > @@ -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?
> > 
> > Correct, it's not actually needed.  The overhead should be negligible but let's
> > get rid of it.  Updated fix patchset attached.
> 
> Sorry I messed up the last commit, v4 is ok.

Patch applied, thanks.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.




pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: Extending range type operators to cope with elements
Next
From: David Steele
Date:
Subject: Re: zstd compression for pg_dump