Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Julien Rouhaud <julien.rouhaud@free.fr>
Cc: Evgeny Efimkin <efimkin@yandex-team.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-11-11T08:37:30Z
Lists: pgsql-hackers
On Wed, Sep 11, 2019 at 06:30:22PM +0200, Julien Rouhaud wrote: > The thing is that pg_stat_statements assigns a 0 queryid in the > post_parse_analyze_hook to recognize utility statements and avoid > tracking instrumentation twice in case of utility statements, and then > compute a queryid base on a hash of the query text. Maybe we could > instead fully reserve queryid "2" for utility statements (so forcing > queryid "1" for standard queries if jumbling returns 0 *or* 2 instead > of only 0), and use "2" as the identifier for utility statement > instead of "0"? Hmm. Not sure. At this stage it would be nice to gather more input on the matter, and FWIW, I don't like much the assumption that a query ID of 0 is perhaps a utility statement, or perhaps nothing depending on the state of a backend entry, or even perhaps something else depending how on how modules make use and define such query IDs. -- Michael
Commits
-
Clarify description of pg_stat_statements columns
- b4deefc39b93 15.0 landed
- 3b57d5af7435 14.0 landed
-
Fix wording in description of pg_stat_statements.toplevel
- f9e6d00df029 14.0 landed
-
Mention that toplevel is part of pg_stat_statements key.
- 7531fcb1fcf5 14.0 landed
-
adjust query id feature to use pg_stat_activity.query_id
- 9660834dd8bf 14.0 landed
-
Update copyright for 2021
- ca3b37487be3 14.0 cited
-
Take the statistics collector out of the loop for monitoring backends'
- b13c9686d084 8.2.0 cited