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 1qWmT3-004LOm-09 for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Aug 2023 23:31:53 +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 1qWmT1-005utn-FY for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Aug 2023 23:31:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWmSz-005utf-VQ for pgsql-hackers@lists.postgresql.org; Thu, 17 Aug 2023 23:31:51 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWmSv-000kbE-TJ for pgsql-hackers@lists.postgresql.org; Thu, 17 Aug 2023 23:31:49 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 80CDD5C0062; Thu, 17 Aug 2023 19:31:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 17 Aug 2023 19:31:43 -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=fm1; t=1692315103; x=1692401503; bh=Zo AeyE0XYcnfCIE0yL39KhC8HzOQmBhdCf4AcV9J9ko=; b=GOaDNFNRTW6eraSHqq MR5ZgkeJcDu7Ge6sFj7pD+TFLvaPDL4FnkmNankaOkdNu15UapJalq9FZ+7NTngG /UL9hv+8xv8Kok3k+yurZhvdHgMZrdCPxrNja7lWOrQL6JLh3gldBkdiGBo3BM83 5J88pgTgcfcNgS+uJjnuyIuMKFRJwd0/s/dVJeMtXhxLJO4+UPDOHcj4MvZHzQSU fwkPLfkao9juXoPB1tImYcxfB5vqw6Gl0k8u7rwPrPwhd1GCpqHjUbvr8dxga2FE n2Ihczke2erEHB9pq4iehqF0yG9XrBV9S5J7/C6o5hYiv5Kd+QvjsjkaCJ7wKSq9 qU4g== 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=fm1; t=1692315103; x=1692401503; bh=ZoAeyE0XYcnfC IE0yL39KhC8HzOQmBhdCf4AcV9J9ko=; b=C5+oWOf7nM4E64zbixBkVUDgrpMEB KGSnAwKtTKv49cxExhpQybmC2hYWMutT75V/+ovMIOgDkAX/3uMWPZQYVBul65qs nSMlYB/pD6WZ5Tp2crFeEgB1frrbE44B8N4yBqEC134J3bxGIn41X52s8XRSeoQt SxdvgMBiCdLNqUKfmtiz4KpXl3d87lFbArlCcFQ9G00B4z6qO4PBcmeEzO0R+m7h JVS0P8XTDreK6d+xPAe0ZV4be6n5mpgWaskO9GGG+UX/BbL2F3cOFVEs6yOArq4i XAoYHcW+2WloZR50PdtqQD1PDENwi9camaat1qeYtZU0tn/+xTf6Ve/jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduvddgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Aug 2023 19:31:41 -0400 (EDT) Date: Fri, 18 Aug 2023 08:31:37 +0900 From: Michael Paquier To: jian he Cc: "Drouvot, Bertrand" , 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> <1f84685f-1ffd-4937-de63-aaa1513a0b7e@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DLwLtTdJaTPKAUAy" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --DLwLtTdJaTPKAUAy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 16, 2023 at 05:11:47PM +0800, jian he wrote: > SELECT calls, toplevel, rows, query FROM pg_stat_statements ORDER BY > query COLLATE "C"; > returns: > calls | toplevel | rows | query > -------+----------+------+------------------------------------ > 1 | t | 0 | CALL ptest3($1) > 2 | f | 2 | INSERT INTO cp_test VALUES ($2, x) > 1 | t | 1 | SELECT pg_stat_statements_reset() >=20 > here, the intermediate CALL part is optimized away. or should I expect > CALL ptest1($1) also in pg_stat_statements? I would have guessed that ptest1() being called as part of ptest3() should show up in the report if you use track =3D all, as all the nested queries of a function, even if it is pure SQL, ought to show up. Now note that ptest1() not showing up is not a new behavior, ~15 does the same thing by missing it. -- Michael --DLwLtTdJaTPKAUAy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmTerdkACgkQnvQgOdby QH2ipw//cMatyFfVfXX7WnYmuWu17OuALo3B//6786VlGmYi8c9FxFYHU91Jykb+ D52iZUGepzrJclEEwQ8ojiiAHyEhso7ZdQl4Fe6EKT6gPg5tpVREXNwVkzBIz2B3 156NTaai6YSO7MgscOu63UXxPa63JXKz/FP2uUHwvsTZXpmaaGhtUACWQk6OM+Gu O6/RerQnFhbmuIHKoEqXoxSM2yjqksDXEW0d57a3F4RhSh3Y9EoneXaBChn7XG72 n0Je4jqWSAkyc2rioa5e8f+IVJUqcNjqhbnUtY/lSsFd2RCDXyMJBCMddQzf8+gT J0EsWCmT0MInWCjrq9U5/p8z6Q1lcfchVGkbDxUoeYuNa1pnMMse5tiRqDgBjdUw gRjbM0YX+/QEKm8oPyjkexupUkgYa5FpOTPIgxuf+MgZZfKYEsRHO7nce27eX7Mg c9U5Fv9X2WnasJHH3FMQO8FNQdGfK+EoVdBaIQmqx0v8xGJvTgLq5g3VJQVoFfS8 nSiSCdGmZssLc2EYhzfmvWyd9G45MeSWLyVjD62ZP9W4m8nfsn+MiKhWIcrYV2wP bmAMZDP93n6nEWCh1PDbHu82IpN0tzJa6P/Exf89h0hTL2AOVF5IltHsJW/qwEZS 043BX9dv2NqtU1n1mbrXpWyR8XbrTu7lKaQ8HLQDJCQJswT57Pk= =nwWT -----END PGP SIGNATURE----- --DLwLtTdJaTPKAUAy--