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 1pTvyt-0005TQ-Gx for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 02:32:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pTvyr-0002VD-Ax for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 02:32:41 +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 1pTvyp-0002V3-Mx for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 02:32:41 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTvym-0005Lk-1s for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 02:32:39 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CEB3E5C0098; Sun, 19 Feb 2023 21:32:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 19 Feb 2023 21:32:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=fm1; t=1676860353; x=1676946753; bh=CdocxURuan a1RwVOc5bAPw0XkHinJUtL0XXwh4UUBnU=; b=XgbjurSgOMshgxkWPdM5e+DWZu EnF17i43zkY+0K1joZBN8/pCbbNMlU10moIwmu9Hii0mgfHMz6yFwzqHbIt8w3VN 7679f2M05N7k//bg/KKwcAdyL/+RHxiNFmCP2Pnq+4km6dOv/97XZnEr0nNQOadb BREPgUivxmOe7+CZ6LhWhlBVoLH28t34T1/UhTQXmOx1PeVFb/2f8ZapVQ5Dvc+k XaT05uz5mCLpolkMD+dz55Vprwf0gnVzrgqfrEtvr4Kp+EWGrGYxicl/LRidAzip 1Wzuy5aZm9E1Pj0JyBY7cBGL1nAV0JcRCpVvfXiRu2SIu6Dt2q35YRlwQQAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm1; t=1676860353; x=1676946753; bh=CdocxURuana1RwVOc5bAPw0XkHin JUtL0XXwh4UUBnU=; b=MVW1nu9l4vfV1rGnW86SKQ5qTXsCJGodHfcWZNZaXY5x rY1Z3jXwYbkiDqm/hpHwBpYZQ+iUHC8mfW8fqub4pMBtjb0AJXKOm8/6qKhKC/1k lID3QwZEu29w+iTm5S6LiQWbihJ4dYvKyIdSjNoWB6cl/WHN06lVdCter2pyee2Z rEgJV6ymkdu5SXFBHjHdPqfdPfTEHgZ1wK0EOZxUM24eWLsf/cuJPOxGnmUOD6ej sGvDbXv98y8Jhm/lun3kgRimq5U2T2Yt5avNhmXWcD29nB0w7qQ2xoj2QG0JkUTB cRELqyHr7mgfArb9eSfkbSpWZ3FcymId4JXhkT/36A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejgedggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Feb 2023 21:32:32 -0500 (EST) Date: Mon, 20 Feb 2023 11:32:23 +0900 From: Michael Paquier To: "Drouvot, Bertrand" Cc: Postgres hackers Subject: Re: Normalization of utility queries in pg_stat_statements Message-ID: References: <0e067034-e92c-302b-24ed-492bca228e26@gmail.com> <14965f63-6d78-45ff-d029-daafe8eddb40@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yszgarbqNF/zRg62" Content-Disposition: inline In-Reply-To: <14965f63-6d78-45ff-d029-daafe8eddb40@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --yszgarbqNF/zRg62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 17, 2023 at 09:36:27AM +0100, Drouvot, Bertrand wrote: > On 2/17/23 3:35 AM, Michael Paquier wrote: >> 0001 looks quite committable at this stage, and that's independent on >> the rest. At the end this patch creates four new test files that are >> extended in the next patches: utility, planning, track and cleanup. >=20 > Thanks! LGTM. Thanks. I have applied the set of regression tests in 0001 and 0002. Note that I have changed the order of the attributes when querying pg_stat_statements, to make easier to follow the diffs generated by the normalization. The unaligned mode would be another option, but it makes not much sense as long as there are no more than two fields with variable lengths. Some extra notes about that: - Should the test for the validation WAL generation metrics be moved out? I am not sure that it makes much sense to separate it as it has a short purpose. - Same issue with user activity, which creates a few roles and makes sure that their activity is tracked? We don't look at the userid in this case, which does not make much sense to me. - Same issue with locking clauses, worth a file of their own? The main file is still named pg_stat_statements.sql, perhaps it should be renamed to something more generic, like general.sql? Or perhaps we could just split the main file with a select.sql (with locking clauses) and a dml.sql? >> I am wondering if others have an opinion to share about that, but, >> yes, 0004 seems enough to begin with. We could always study more >> normalization areas in future releases, taking it slowly. >=20 > Agree. These last ones are staying around for a few more weeks, until the middle of the next CF, I guess. After all this is done, the final changes are very short, showing the effects of the normalization, as of: 6 files changed, 45 insertions(+), 35 deletions(-) -- Michael --yszgarbqNF/zRg62 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmPy27cACgkQnvQgOdby QH3nWA//Ys/Tdja1FJBkbeftRzHPIIPJuawHcCoG7ptyIWc35MzZI3h0N/U8Nx+u dyn07y57k2IO4hXHjqDHyaJVMzId+qKSdmxJt2oDfIxgMxvR2kP2ErV+LQJB2npg nLGq1BZa4Mwn5QNZrjyx9Su7GzxejAlrkg7QJ+lp/g1I0dFY2y0uxjw1c9k69oce IHJiSA+GPdQLz5eBa2Z//cOEafN77qB50mxwmtov+XxLA2dgfY/4pDUM2VjVXsBF TWL2VILJU0tG+TudyBXy+UmJEnWNF9IZjn2g9yVoJGzC6KdzU40ijEjI7OsWStfK ES/NG+FcbHYmbqAyqY3Hv3ZAiD0JJH+pEL9LX6UqaRIMW2iMT4YN538xoEFFgYzI mZwA5fFdzmHgZEiUoxh/aLjsSQViVdPNQ4vgL/Vn3eK+gw7lzFns+H2dkt/HTm8n gWEYAdcdfOjZhj5Bg+1BUGv1xrgoDwX+vYF9PoyWx1YBUAMvl+5mHQhJSonNp5OD kixfsOFlfcuvS89xDrBlagkmSwwKOW8Q7mdQ9iXx5MEsQWSBC6DsVGvwYCNuUNSZ M/Rv7FUeNRZl9N11dLNAorfjwIAXyFHC5LxQxf++Q+ABd0LjgP9Wd7eVE5akPmkD RiXjfmvpM/965sIkGVS3uDkkbADKKzLY9epcmAgQKcqZb3oTdK8= =ejMC -----END PGP SIGNATURE----- --yszgarbqNF/zRg62--