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 1lTnqE-00055s-Ix for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Apr 2021 15:42:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lTnqC-0001sA-Mj for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Apr 2021 15:42:08 +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 1lTnqC-0001s3-G9 for pgsql-hackers@lists.postgresql.org; Tue, 06 Apr 2021 15:42:08 +0000 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTnq5-0007jX-VN for pgsql-hackers@lists.postgresql.org; Tue, 06 Apr 2021 15:42:07 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 107061400; Tue, 6 Apr 2021 11:41:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 06 Apr 2021 11:41:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=JzFpFNNRJF0zNn9dd4QKruP+XT4i+PNIc0UfrAaGfPg=; b=tQnaU+Gk sN3MNgCUDXnTgRWcgexdH6K2O1shj/TbkxpNNjjZhelhnzE/UIjrJX+Kk6eGagmO fWYuWnpgBSgtJA31HyJw3hSUYJ9GTwO5XYzHqdgKnoo+kxILWa7A0ipUxZnwTI6b rsf88xcEpRf1JuNDCeJR3D3wPxuB7WEDeD2xuoUI3n9ptpep7zZFDXlO0Fb+YCDf QmB8EEvW6V+AhQPQZDI8ZU3QmQl0JMoeRG4Br8V0N9HwH8hWl3mLeXkOMRdaXura elX3PfI7P6GYI1EDf2rRQ8IzmQnyRvTzO9VFoPPNGssqFwwRrF+o8gWvBSBeWGbv yKGaAFOM9zQQ7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejhedgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueffhfejieeuueffgedvudekgeeltdeviedvieeufeei ieevgfetheeufeethedvnecukfhppeduledtrdelhedrudelrdelheenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 79D5C1080066; Tue, 6 Apr 2021 11:41:55 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 5DB712A0A89; Tue, 6 Apr 2021 11:41:52 -0400 (-04) Date: Tue, 6 Apr 2021 11:41:52 -0400 From: Alvaro Herrera To: Nitin Jadhav Cc: Bruce Momjian , Julien Rouhaud , Hannu Krosing , Robert Haas , Pavel Stehule , Tom Lane , 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: <20210406154152.GA26092@alvherre.pgsql> 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 2021-Apr-06, Nitin Jadhav wrote: > I have reviewed the code. Here are a few minor comments. > > 1. > +void > +pgstat_report_queryid(uint64 queryId, bool force) > +{ > + volatile PgBackendStatus *beentry = MyBEEntry; > + > + if (!beentry) > + return; > + > + /* > + * if track_activities is disabled, st_queryid should already have been > + * reset > + */ > + if (!pgstat_track_activities) > + return; > > The above two conditions can be clubbed together in a single condition. I wonder if it wouldn't make more sense to put the assignment *after* we have checked the second condition. -- Álvaro Herrera Valdivia, Chile