Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxxdZ-004fui-J2 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Oct 2023 22:55:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxxdY-004sKT-2Q for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Oct 2023 22:55:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxxdW-004sKL-AI for pgsql-hackers@lists.postgresql.org; Tue, 31 Oct 2023 22:55:03 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxxdO-003M9t-So for pgsql-hackers@postgresql.org; Tue, 31 Oct 2023 22:55:00 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AF2B35C0203; Tue, 31 Oct 2023 18:54:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 31 Oct 2023 18:54:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1698792892; x=1698879292; bh=WA K2qNb1vltY0i+fcDXoYQ/xCeT/gmMTainq7VSFXIo=; b=nwZk2N6nHnQX7SyH1O QjRNTv70X4BBaTCiUmipeedPolagmA+wlekqtutrNYQxuWhwtr/FvbOfZCRqExa3 0+e39P0dlknU9ZZsqcEYk6V6oV4dFj6LA2Sz1KFlzHW0d/T7XILbpA8hReHoR9jj w8nvXvSAuyCvwvm6RLQwVHbXPT16U4c221KFov3gRhRakkmt6KtQ0d6opaoXXXCg s3gZc72lgJcRbZZslLecc1dGOhvlVAiK4M+QrV9XpbeHMGB+LIbNxSQrRHX5ahLk hqw1CmIV2aAtdGKKaEsBSnzoZtd1QCSzV/ABM2vzSGSK80IBi2fKS1ZiSwuvMiBf VDvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references: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=1698792892; x=1698879292; bh=WAK2qNb1vltY0 i+fcDXoYQ/xCeT/gmMTainq7VSFXIo=; b=HSS5sM9RJhvuX9wo0DvP18xAo64Ma HQSsFQvWcyz9Q3G8gBWFAGW9hYyuZ8H9r3UEJmOjZ1tHvbp/rLRAcx0EFSBYD0ct V5roWnTzXkx7g17Pj8hBqd0rImErIh6vsV1UhUzyYDy/VOsmU7L0wGAaWzVtk58M gevI+zaivzRUbacvJfMg+BdVJ16tyM5cWfN8ANN/F2VCxWQDZayRqoJwfMwm2+Ks I7qBwkdAqiAAvbGp3IlKNQdlCSYioi/rhbBtZIGcZp4QB2qrsdGzhSPRqQrx+EAT ALy8aEGPtDHjLR6j0I0Gfd6eGON3lv+0HGEezxdnVZIpWZHcDvlrBxpIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtfedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepteelieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdej necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitg hhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 Oct 2023 18:54:50 -0400 (EDT) Date: Wed, 1 Nov 2023 07:54:46 +0900 From: Michael Paquier To: torikoshia Cc: Kyotaro Horiguchi , bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Add new option 'all' to pg_stat_reset_shared() Message-ID: References: <4291a55137ddda77cf7cc5f46e846daf@oss.nttdata.com> <20231030.171713.274529745163206826.horikyota.ntt@gmail.com> <20231031.115931.1009045759469844714.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jeQQ8Dovcf6Uf7LK" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --jeQQ8Dovcf6Uf7LK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 31, 2023 at 04:26:18PM +0900, torikoshia wrote: > Yes, calling pg_stat_reset_shared() for all stats types can do what I wan= ted > to do. > But calling it with 6 different parameters seems tiresome and I thought it > would be convenient to have a parameter to delete all cluster-wide > statistics at once. >=20 > I may be wrong, but I imagine that it's more common to want to delete all= of > the statistics for an entire cluster rather than just a portion of it. If more flexibility is wanted in this function, could it be an option to consider a flavor like pg_stat_reset_shared(text[]), where it is possible to specify a list of shared stats types to reset? Perhaps there are no real use cases for it, just wanted to mention it anyway regarding the fact that it could have benefits to refactor this code to use a bitwise operator for its internals with bit flags for each type. -- Michael --jeQQ8Dovcf6Uf7LK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmVBhbYACgkQnvQgOdby QH0IXA//fjatBtQ5qGnGUF8mXZMrzaKXgGFPm+jxkKpSRVQir4CLc+ZnRpxuiNTH rjzIcltp+atibMCa2mrqL19sZWnsbsxPLeiEVrIsrIiFoGuZ5UJrhfEovRV78vgU B97NZjs6mcQpabfiQ2IXT8PujZoScMKppVdYNKTRykW4kLOmWW81SO5OWFGEXLlT 5NDz1abY0D0CvS0KdiaJ/ADXAo201UJT4KWUfL6/w7E8hfQJwTq88Hu9qjl7ykUH 02vigFcWT2CXLFgg5slitRIqoxuxTwnVe7PDaQSamBdkW1OGik6TQTH9JO2NTbvL OkfrsuWZHHeVTF3jHGLEwZhPXPy4ZOsvXYiHlDK1euVYxRGvNvxfdCQKxxD/lr2W Iiks9N/Dkn4omV6sIq9jXCGiZMQvUJMpRRtGpF1W7ZWlvshrhcPNBb/5q/8AAu27 hxwzd0aL0I2P06/BPxZSKFCY1fhsCAh3CLPRc4w/zny+4ndJPt13cdvd7RB11x2Q bOxuwZz1xSyR+c53OtVBy3TSG9U/B/FbGLZaEPoTV0m8LLYRzWvQzkWLGM7yNxMe KNOA/PIn1se4gZdBAfXofdKigUa/z+V1xNVO04t9JHmyChIjGBaM/um1HL6SbzY0 S8xnHT/PtYtjQtIl7wB3Wx6AdnJ2IraWw1zTTRmTQg0FfyFwem8= =QTEG -----END PGP SIGNATURE----- --jeQQ8Dovcf6Uf7LK--