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 1rhOL9-00BEKE-Cz for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Mar 2024 06:31:51 +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 1rhOL7-00Dwty-V1 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Mar 2024 06:31:50 +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 1rhOL7-00Dwtq-M3 for pgsql-hackers@lists.postgresql.org; Tue, 05 Mar 2024 06:31:50 +0000 Received: from fout7-smtp.messagingengine.com ([103.168.172.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhOL0-002qUy-RG for pgsql-hackers@lists.postgresql.org; Tue, 05 Mar 2024 06:31:49 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id D1C9B13800A7; Tue, 5 Mar 2024 01:31:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 05 Mar 2024 01:31:41 -0500 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:subject :subject:to:to; s=fm1; t=1709620301; x=1709706701; bh=1Mh+IcZTRC P8OOqZIRBkUtDwwkXnYaSBptxaJSP1nNk=; b=ITIqoH2cnG1Yv9sMDmKvdvzpHW 10/Mddt5lkvGcOy13x389BAa0SbOfm2OxpGMKCISQEw9/v8REXw2VVtEQjtewX98 431/n7U4DaWVdeRHgmGGBpOZmgAEYrEZmO2IrBATsWz1S63gHZVWlfmfp7kLQaEl MFTEuW0KkozAao5BGGxTQfxD2Eu0ddvw4CrhQPNQMG0gZ1tJ6Qc2PahY7tSBC37X Mt3hQaqbIy+ec9QGmjBAf51QwwGzbZhfXvSn/EMdRvnR6srIeoWwpl8uTf/5RSDh GQeEHEeXn3UnDTNKwVzAqAI/LY6yxtnwaHTSeDTDpHuoSbu+LmJNBgadwZ+Q== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709620301; x=1709706701; bh=1Mh+IcZTRCP8OOqZIRBkUtDwwkXn YaSBptxaJSP1nNk=; b=K8JsDCBA9BEK9waRVHCIWRVZCkk6rGDy35mFy84kjDqo UlLPOc9cxki8oCP1zIuohctdXXdAvxsVAhDQo2BMVZmx/HL+awACFq1vZ25zP82D wp7Ww92pWaLYa1w3n5LcF6FbB/lk0xSZBfchXYeUNoJVrxk63NXjJxWeGdkIC6Ji grQdzZhH/OhNJcpzOhRuR8RQdvPuVLPvG6UTFhSkYJ59M1m/HMJx3pJAS1sIHsGX SQG6xfkzqvaa1LqEtsFww0sKngU+0UEH0qhtZzQbrRn2RbvGM+IFXPr/nI3+uu2A umE56MDwS4AhiwtMhTMqC0cp3jRjYlBbN7XUK1O23g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheekgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffejvefgveduvdejtddvtdei jeehudeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Mar 2024 01:31:39 -0500 (EST) Date: Tue, 5 Mar 2024 15:31:25 +0900 From: Michael Paquier To: Aleksander Alekseev Cc: pgsql-hackers@lists.postgresql.org, Mats Kindahl Subject: Re: Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pVwmDVI4ByOc2Edy" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pVwmDVI4ByOc2Edy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 04, 2024 at 03:41:16PM +0300, Aleksander Alekseev wrote: >> I wanted to hook into the EXPLAIN output for queries and add some >> extra information, but since there is no standard_ExplainOneQuery() I >> had to copy the code and create my own version.=20 >> >> Since the pattern with other hooks for a function >> WhateverFunction() seems to be that there is a >> standard_WhateverFunction() for each WhateverFunction_hook, I >> created a patch to follow this pattern for your consideration. So you've wanted to be able to add some custom information at the end or the beginning of ExplainState's output buffer, before falling back to the in-core path. What was the use case, if I may ask? >> I was also considering adding a callback so that you can annotate >> any node with explanatory information that is not a custom scan >> node. This could be used to propagate and summarize information >> from custom scan nodes, but I had no immediate use for that so did >> not add it here. I would still be interested in hearing if you >> think this is something that would be useful to the community. That depends. > I registered the patch on the nearest open CF [1] and marked it as > RfC. It is a pretty straightforward refactoring. >=20 > [1]: https://commitfest.postgresql.org/48/4879/ I know that we're in the middle of commit fest 47 while this is in 48, but I can't really see a reason why we should not do that earlier than v18. One point about core is to be flexible for extension code. So I\ have no objections, others are free to comment. -- Michael --pVwmDVI4ByOc2Edy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXmvD0ACgkQnvQgOdby QH2N/Q/7BS208ygJFhVwE2KpgKnu/s0/a652WpIlwmPjslqnlSYxkVrEg/yXZslJ 65X0cyKhiq866P4EOKLaFMj244iD1BgEi/pvNLJOJ6ZdK/ymiw8tjof/zeqPMBpZ 94wwF9tmdxcuAUv9RAQ6Z3IpX+2YO7Asz37P6bbhZ2B5LdOsaojGFTJvukTZzmhZ mKscmEaRKicujhWK3nfIN7KhPSSsKC+bxQUxwFvPtjQUOI/rJVivO4Wu3qYKg0vz aVTdFyF4hwjdxJFH8FPFQ0C6DjmIIfvfNwiEaGZM/zXJCVPZUe73zTRZgEGi9hoo DMhs6/YY+eLtWa767IZjM4pfnknAtamA91ZAcUgp0C9/jGyjmlPJniofmKUiBKWw jmROkIjDdK0rcwjnQjjDiurgeEOVzi2pjyn5p1jWJhv/Jza4FoV/P5FiO259z8KC GvmgHyrrt91yU5iw2ZKyw+RxREUmV4zAyTVELAOpbKVYSaKPBvMgWeBCnE9922Og ESHOQISj7EqyMTzt0pcN55XR01M5G753wXyPz0xoA5BRI3QsP+8vJug02DiNZRGS xOah7zD8GmI06L4A7+DBB2X9BAUoARRCodXpJ/tayPBmVvkxIAjbwlzeehePX/KY HHLp74favkh7HMolAZkenqPSdSes4cHsKtL+HoC5zRmje1vVJZM= =ZmdY -----END PGP SIGNATURE----- --pVwmDVI4ByOc2Edy--