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 1kTRHx-0005xV-8f for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Oct 2020 15:05:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kTRHw-0001CX-7H for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Oct 2020 15:05:00 +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 1kTRHw-0001Av-0U for pgsql-hackers@lists.postgresql.org; Fri, 16 Oct 2020 15:05:00 +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 1kTRHt-0004au-MU for pgsql-hackers@lists.postgresql.org; Fri, 16 Oct 2020 15:04:58 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kTRHl-00019n-1c; Fri, 16 Oct 2020 11:04:49 -0400 Date: Fri, 16 Oct 2020 11:04:49 -0400 From: Bruce Momjian To: Julien Rouhaud Cc: Tom Lane , Robert Haas , Michael Paquier , Alvaro Herrera , 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: <20201016150449.GA23488@momjian.us> References: <3250173.1602533250@sss.pgh.pa.us> <20201012205340.GD24889@momjian.us> <20201014140915.GJ24889@momjian.us> <20201014142523.GA9415@momjian.us> <3599578.1602685897@sss.pgh.pa.us> <20201014144050.GB9415@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Oct 15, 2020 at 11:41:23AM +0800, Julien Rouhaud wrote: > On Wed, Oct 14, 2020 at 10:40 PM Bruce Momjian wrote: > > There is that, and log_line_prefix, which I can imaging being useful. > > My point is that if the queryid is visible, there should be a reason it > > defaults to show empty. > > I did some naive benchmarking. Using a custom pgbench script with this query: > > SELECT * > FROM pg_class c > JOIN pg_attribute a ON a.attrelid = c.oid > ORDER BY 1 DESC > LIMIT 1; > > I can see around 2% overhead (this query is reported with ~ 3ms > latency average). Adding a few joins, overhead goes down to 1%. That number is too high to enable this by default. I suggest we either improve the performance of this, or clearly document that you have to enable the hash computation to see the pg_stat_activity and log_line_prefix fields. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee