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 1pG1CB-0000zV-1g for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jan 2023 17:16:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pG1C9-00071O-T8 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Jan 2023 17:16:53 +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 1pG1C9-00071F-KM for pgsql-hackers@lists.postgresql.org; Thu, 12 Jan 2023 17:16:53 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pG1C5-0006XC-Sv for pgsql-hackers@lists.postgresql.org; Thu, 12 Jan 2023 17:16:53 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 86A895C010F; Thu, 12 Jan 2023 12:16:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 12 Jan 2023 12:16:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1673543807; x=1673630207; bh=a pWgQyVghBdsrnkzg/n830sSZqeQhnkpcV3Bls/FBBo=; b=hgWDODfNQLQTXmNh1 zEGS7ivfP/PA28eaWGO/QI9xgUO0uLPwbqAe1+D8bfYta0Oq/a5SBq+ffprDr/Y3 aB5CexQSy3+HBv2om9Zohj9cide8CoP6FrIYlLiLI/Hp+VHLUopCs6NwEze/a7Cj Waz1OmpqRHi8EBV22PCaj8hjb0DuRQ11Lju0Q0+Rw8YKvIUDlTUO7B+5xNJih8VT odBsnHKQUKKED7JqyXFsuU17SNORK3sevyU2ZDLAYMa/7WCkvbQOvCY71ip2SXsV wR86/WPc+IHTKA0FYphzDISRayEcbqJrEBNH0dhUMerHhJXTr9R4q+uQb39zdZ47 GUIIA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeigdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 12:16:47 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 125071D; Thu, 12 Jan 2023 18:12:52 +0100 (CET) Date: Thu, 12 Jan 2023 18:12:52 +0100 From: Alvaro Herrera To: "Drouvot, Bertrand" Cc: PostgreSQL Hackers Subject: Re: Remove nonmeaningful prefixes in PgStat_* fields Message-ID: <20230112171252.xucefmthy5l4l2ec@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9142f62a-a422-145c-bde0-b5bc498a4ada@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Jan-12, Drouvot, Bertrand wrote: > Please find attached a patch to $SUBJECT. > > It is a preliminary patch for [1]. > > The main ideas are: 1) to have consistent naming between the pg_stat_get*() functions > and their associated counters and 2) to define the new macros in [1] the same way as it > has been done in 8018ffbf58 (aka not using the prefixes in the macros). I don't like this at all. With these prefixes in place, it's much more likely that you'll be able to grep the whole source tree and not run into tons of false positives. If you remove them, that tends to be not very workable. If we use these commits as precedent for expanding this sort of renaming across the tree, we'll soon end up with a very grep-unfriendly code base. The PGSTAT_ACCUM_DBCOUNT and PG_STAT_GET_DBENTRY macros are just one argument away from being able to generate the variable name including the prefix, anyway. I don't know why we had to rename everything in order to do 8018ffbf5895, and if I had my druthers, we'd undo that. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/