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: Bruce Momjian <bruce@momjian.us>
Cc: Julien Rouhaud <rjuju123@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Tom Lane <tgl@sss.pgh.pa.us>, torikoshia <torikoshia@oss.nttdata.com>, Atsushi Torikoshi <atorik@gmail.com>, Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>, Robert Haas <robertmhaas@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Evgeny Efimkin <efimkin@yandex-team.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-10-07T01:42:49Z
Lists: pgsql-hackers
On Tue, Oct 06, 2020 at 09:22:29AM -0400, Bruce Momjian wrote: > I propose moving the pg_stat_statements queryid hash code into the > server (with a version number), and also adding a postgresql.conf > variable that lets you control how detailed the queryid hash is > computed. This addresses the problem of people wanting different hash > methods. In terms of making this part expendable in the future, there could be a point in having an enum here, but are we sure that we will have a need for that in the future? What I get from this discussion is that we want a unique source of truth that users can consume, and that the only source of truth proposed is the PGSS hashing. We may change the way we compute the query ID in the future, for example if it gets expanded to some utility statements, etc. But that would be controlled by the version number in the hash, not the GUC itself. > When computing a hash, the queryid detail level and version number will > be mixed into the hash, so only a hash that used a similar query and > identical queryid detail level would match. Yes, having a version number directly dependent on the hashing sounds like a good compromise to me. -- 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