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 1lMYyc-0004g4-Jg for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Mar 2021 16:24:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMYyb-0002Ii-0z for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Mar 2021 16:24:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMYya-0002Ib-Qd for pgsql-hackers@lists.postgresql.org; Wed, 17 Mar 2021 16:24:52 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMYyY-00063g-FG for pgsql-hackers@lists.postgresql.org; Wed, 17 Mar 2021 16:24:51 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lMYyS-00018y-B2; Wed, 17 Mar 2021 12:24:44 -0400 Date: Wed, 17 Mar 2021 12:24:44 -0400 From: Bruce Momjian To: Pavel Stehule Cc: Tom Lane , Julien Rouhaud , Alvaro Herrera , Robert Haas , Michael Paquier , torikoshia , Atsushi Torikoshi , Tatsuro Yamada , Tomas Vondra , Evgeny Efimkin , PostgreSQL Hackers Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? Message-ID: <20210317162444.GD16650@momjian.us> References: <20210314080645.uk5gonqifgasdvo7@nol> <20210317151701.GA16650@momjian.us> <3518601.1615994918@sss.pgh.pa.us> <20210317154023.GB16650@momjian.us> <3519983.1615996898@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 17, 2021 at 05:16:50PM +0100, Pavel Stehule wrote: > > > st 17. 3. 2021 v 17:03 odesílatel Tom Lane napsal: > > Bruce Momjian writes: > > On Wed, Mar 17, 2021 at 11:28:38AM -0400, Tom Lane wrote: > >> I still say that it's a serious mistake to sanctify a query ID > calculation > >> method that was designed only for pg_stat_statement's needs as the one > >> true way to do it.  But that's what exposing it in a core view would do. > > > OK, I am fine with creating a new method, and maybe having > > pg_stat_statements use it.  Is that the direction we should be going in? > > The point is that we've understood Query.queryId as something that > different extensions might calculate differently for their own needs. > In particular it's easy to imagine extensions that want an ID that is > less fuzzy than what pg_stat_statements wants.  We never had a plan for > how two such extensions could co-exist, but at least it was possible > to use one if you didn't use another.  If this gets moved into core > then there will basically be only one way that anyone can do it. > > Maybe what we need is a design for allowing more than one query ID. > > > Theoretically there can be a hook for calculation of queryid, that can be by > used extension. Default can be assigned with a method that is used by > pg_stat_statements. Yes, that is what the code patch says it does. > I don't think it is possible to use more different query id for > pg_stat_statements so this solution can be simple. Agreed. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.