Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPyea-0005u4-Dh for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Oct 2020 01:54:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPyeY-0007Bh-67 for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Oct 2020 01:54:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPyeX-00079f-Vf for pgsql-hackers@lists.postgresql.org; Wed, 07 Oct 2020 01:54:01 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPyeQ-0005p7-GJ for pgsql-hackers@lists.postgresql.org; Wed, 07 Oct 2020 01:54:01 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kPyeI-00066x-PA; Tue, 06 Oct 2020 21:53:46 -0400 Date: Tue, 6 Oct 2020 21:53:46 -0400 From: Bruce Momjian To: Michael Paquier Cc: Julien Rouhaud , Alvaro Herrera , Tom Lane , torikoshia , Atsushi Torikoshi , Tatsuro Yamada , Robert Haas , Tomas Vondra , Evgeny Efimkin , PostgreSQL Hackers Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? Message-ID: <20201007015346.GF12277@momjian.us> References: <1817289.1601934179@sss.pgh.pa.us> <20201005225842.GA8918@alvherre.pgsql> <20201006021819.GA10975@momjian.us> <20201006032350.GA3686@momjian.us> <20201006053458.GA429@paquier.xyz> <20201006132229.GB3686@momjian.us> <20201007014249.GB2256@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007014249.GB2256@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Oct 7, 2020 at 10:42:49AM +0900, Michael Paquier wrote: > 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. Oh, if that is true, then I agree let's just go with the version number. > > 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. Good, much simpler. I think there is enough demand for a queryid that I would like to get this moving forward. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee