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

From Nikolay Samokhvalov
Subject Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activityview?
Date
Msg-id CANNMO+J09i9HDikELGvU=gp1D5V5POaMZWLTSQ=Y4GMY0fYjwg@mail.gmail.com
Whole thread Raw
In response to Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activityview?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hello

On Sat, Mar 16, 2019 at 7:32 AM Robert Haas <robertmhaas@gmail.com> wrote:
Also, I think this is now the third independent request to expose
query ID in pg_stat_statements.  I think we should give the people
what they want.

Count me as the 4th.

This would be a very important feature for automated query analysis.
pg_stat_statements lacks query examples, and the only way to get them is from the logs.
Where we don't have queryid as well. So people end up either doing it manually or writing
yet another set of nasty regular expressions.

Routing query analysis s a crucial for any large project. If there are chances to implement
queryid for pg_stat_activity (or anything that will allow to automate query analysis)
in Postgres 12 or later -- this would be a great news and huge support for engineers.
Same level as recently implemented sampling for statement logging.

By the way, if queryid goes to the core someday, I'm sure it is worth to consider using
it in logs as well.

Thanks,
Nik

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Block level parallel vacuum
Next
From: Julien Rouhaud
Date:
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activityview?