Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5Dvu-0007dM-1h for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Mar 2019 18:21:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5Dvs-0001mS-Ef for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Mar 2019 18:21:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5Dvs-0001mA-3e for pgsql-hackers@lists.postgresql.org; Sat, 16 Mar 2019 18:21:20 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5Dvo-00033G-3R for pgsql-hackers@postgresql.org; Sat, 16 Mar 2019 18:21:18 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 864AE12A11E46 for ; Sat, 16 Mar 2019 11:21:13 -0700 (MST) Date: Sat, 16 Mar 2019 11:21:13 -0700 (MST) From: legrand legrand To: pgsql-hackers@postgresql.org Message-ID: <1552760473548-0.post@n3.nabble.com> In-Reply-To: References: <21800.1552701008@sss.pgh.pa.us> Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, This is available in https://github.com/legrandlegrand/pg_stat_sql_plans extension with a specific function pgssp_backend_queryid(pid) that permits to join pg_stat_activity with pg_stat_sql_plans (that is similar to pg_stat_statements) and also permits to collect samples of wait events per query id. This extension computes its own queryid based on a normalized query text (that doesn't change after table drop/create). Maybe that queryid calculation should stay in a dedicated extension, permiting to users to choose their queryid definition. Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html