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.96) (envelope-from ) id 1wBChH-000pyr-2b for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 14:19:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wBChG-00CVVM-0g for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 14:18:59 +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.96) (envelope-from ) id 1wALRs-0051me-0g for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 05:27:32 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wALRq-00000001FCc-12Mi for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 05:27:32 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-8a093c784b0so82593276d6.3 for ; Tue, 07 Apr 2026 22:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775626048; cv=none; d=google.com; s=arc-20240605; b=EMmNKzpl7duIwJk6wKZhlqTI1+e1P6fsIwoeV+2VQcDkZBN76YPtiUBhKUdVbTK6lh hdFpB73/XYm1Cg2UX+JCriRW5YIOT5WpH1ZS+bBcQyNPEVmrENj6Qy4TDDkqoRtdD4PE XeMUTnI4OFAzqG5LaTFcgKONE17ABBqJszIGq8fSUufoYkdurs3uL6j6uQZBZcsEzb4V xygHOPVcEmu9ggm0RatbKWJB3eKdix5oK5o5oMcKgKgV6bLy6vjaBTP39dYEmly1aRoc N+n36yVSm1wfltZflAP02Yt3yNBWBsl2IAXMvEc8H/XLMZW6ElQWxkTByxVuPyzSEDZ3 RG+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=GakEJA1HPGmez40F4/TqRjbErj6zEaxfmETo9XypOXg=; fh=PqSsPu2DRy+yGjlCPlCZ6GDQseoow+Mo9NMhKxlDF2c=; b=cj+D5c6U7/QzEw8b3rlTfs7iy97l6yjpqnomTSwItMNHBdjaPgsRmOP8GJBkkccq14 ZyKeG7QV5jPit6MX1blhEqRM9uOBDnfcW9GxY/EyuliZhkKzUWl9OqXrrO7Iz+Rg3RSY 3s6tnlx/WxTW7Dg30gA2gz6BS9/mcfrUZz8KmRkZ8m93SlrOEwW2VYeduOWRW5FJyz30 6BFI5VSENjAT3tuxA53sZSAAdmNIjyjamKdVgGlOie+2wcd9PtFypbmUsONRuGUpF+hy Cj5SrRb+5F6OSEso5oLyPCG9+LNGxKz563uMs6JtaA2u4ZiuTT5Bi1iqkgBGkekrXEWY LR9Q==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775626048; x=1776230848; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GakEJA1HPGmez40F4/TqRjbErj6zEaxfmETo9XypOXg=; b=lS7myb0Qatw03BqRnAmTYrN2AVeb8+t8Kg9V+iZ3LUa4ZiDEQ5O1A2rHnT+BN+UFD7 QJYAqUlmbQRP60LpJ1AYSZAjSIuH6zJBd+0yVGN7A8vSsTQ0W+9jXPT2bmvcR+dva7TE k7eBbypfncIvgueEVIPgBSeDxIkIRa6kDo0Xn4OeC9s2ixrczO+m5f/RMxEtXgtcytjE 0pi+8NIDbvBCg3ub1IK1VsZOo2CpQ8o9+XkEIAJsp5yc5wqbbBSC3kyiQut7NMkt270K O273OxYZk1VVkv4/HghOrzfmJAi8m1vzuI1D4VBaA1k8Q6pDY+wOrCkZJRo84gqfAeAZ IEEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775626048; x=1776230848; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GakEJA1HPGmez40F4/TqRjbErj6zEaxfmETo9XypOXg=; b=giZ4fgs3khTSRlnp67PJsyZP6f2b0D96YiOIBZ2WJjs1WqbmWgApsZ4EXI93mrL3m9 mps+YOeXlvTCk+oNC3P+7YrEZ563naRyO6LINGH34WsSFuxgNa8aPIuufPcqdzX4BrKi 8IpkY40Tzhaam4TGTckOlShUXDP+XODdhvi8gSylbyNllFkqQ/dfumJkHSVSQcMLIvBh UYmgygJ89ebqWR9K0Q/4GY9lbo6M5lj8CA665n1yGHfkOUwLuPBOZQaHoCZDh22EXfyW 5D81ykU7te9HTAiXjM5GmZFilxSuBk8sTUObglTWfNbafalx5PFlt0FPwbpHh8kGixyP VLZA== X-Gm-Message-State: AOJu0YyDYmn9gYgjye80mVCkH7BOYBh3MeQoz2Cc+ab4o+a5bbgVAlZK LXgXsnCqkF+3KH6enjZe9UBSqzRWLIyMyXelgG/QJGeMcgh/Sjmw3QtixRPF9N62aq3vfHeDWCU atGV/D9pydBj6YPeIcZpljb02dyqaYDRyReRDiDy05YVhchkPPxvXf+1SjBE= X-Gm-Gg: AeBDies54E7UszJPgOEALLrk4Lxc+M2wtAaVT652wAQWbijGHZTiZ3NpI0rAM+dcv4A op9KDZJybfMcepU6MT1U5ACM0INIdrZTwszlY4XNtkTeYC3D+KkxDYtYB0d1925i9VyWauViy6Q izqsv2y0UV4eO6g0tm37ieASWZETkuKLP2Py+gL9tASLt7k+BGOtOGYMKHARppxT5hb6F9J1Bfh XKsuxoQV9N3inSGwzpco22mZF31IWTDIaxzMn02OnryukWnfbIvxB1zFJ1ySiXCogFx6RCbU5VV comSKyQ85a2WVkr7UmZ2iC6AlkFjyVWzIh4NOQ== X-Received: by 2002:a05:6214:4d06:b0:899:f9f5:97a9 with SMTP id 6a1803df08f44-8a7043edfe6mr263294656d6.37.1775626048029; Tue, 07 Apr 2026 22:27:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Siddharth Kothari Date: Wed, 8 Apr 2026 10:57:16 +0530 X-Gm-Features: AQROBzDa0X3jdZc4nXHFkN9MgdjBiX-coMLN3RdLVZtaCGTAn8QfjqsE4J0hihs Message-ID: Subject: Re: [PATCH] Add RetrieveInstrumentation hook for CustomScan providers To: pgsql-hackers@lists.postgresql.org Cc: Vaibhav Jain , Madhukar Content-Type: multipart/alternative; boundary="000000000000d963bc064eec2709" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d963bc064eec2709 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi everyone, I=E2=80=99m just checking in to see if anyone has had a chance to look at t= his or if there=E2=80=99s any further information I should provide to help with th= e review. I have also added the patch to PG20-1 CF queue, the link is https://commitfest.postgresql.org/patch/6524/. Thanks, Siddharth On Wed, Feb 18, 2026 at 3:09=E2=80=AFPM Siddharth Kothari wrote: > Dear PostgreSQL Hackers, > > This email proposes a patch to enhance the CustomScan provider interface. > The patch file, > 0001-Add-RetrieveInstrumentationCustomScan-hook-for-Custo.patch, is > attached. > > *Problem:* > > CustomScan providers currently lack a standard method to aggregate > instrumentation data from parallel workers back to the leader process > before the Dynamic Shared Memory (DSM) segment is unlinked. This makes it > difficult to gather comprehensive performance metrics from parallelized > custom scans. > > *Solution:* > > This patch introduces a new optional hook, > RetrieveInstrumentationCustomScan, to the CustomExecMethods struct. This > hook allows custom scan providers to implement logic to collect and > consolidate instrumentation from shared memory or worker states during th= e > parallel query cleanup phase. This hook is invoked via the new > ExecCustomScanRetrieveInstrumentation function, called from > ExecParallelRetrieveInstrumentation for T_CustomScanState nodes. Since > the hook is optional (checked for NULL before calling), it maintains full > backward compatibility. > > *Testing & Compatibility:* > > - The patch compiles and passes all core regression tests (make > check-world) on my x86_64 instance. > - The changes are not platform-specific. > - Regression Tests: This patch provides a new *capability* for custom > scan providers. Since the hook's functionality is only realized when > implemented by an extension, specific tests would naturally reside wit= hin > that extension rather than in the core regression suite. > > This patch does not directly address a specific item on the official TODO > list but enhances the extensibility framework. > > I believe this patch is complete and ready for review. I look forward to > any feedback and am happy to make revisions. I will also add this patch t= o > the next CommitFest. > > Thank you, > > Siddharth Kothari > --000000000000d963bc064eec2709 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi everyone,=C2=A0

I=E2=80= =99m just checking in to see if anyone has had a chance to look at this or = if there=E2=80=99s any further information I should provide to help with th= e review. I have also added the patch to PG20-1 CF queue, the link is https://commitfest.pos= tgresql.org/patch/6524/.

Thanks,=C2=A0
Sidd= harth

On Wed, Feb 18, 2026 at 3:09=E2=80=AFPM Si= ddharth Kothari <sidkot@google.com<= /a>> wrote:
<= div dir=3D"ltr">

Dear PostgreSQL Hacker= s,

This email proposes a patch to enhance the CustomScan provider int= erface. The patch file,=C2=A00001-Add-RetrieveInstrumentationCustomSc= an-hook-for-Custo.patch, is attached.

Problem:

CustomScan providers currently lack a standard method to aggregate = instrumentation data from parallel workers back to the leader process befor= e the Dynamic Shared Memory (DSM) segment is unlinked. This makes it diffic= ult to gather comprehensive performance metrics from parallelized custom sc= ans.

Solution:

This patch introduces a new opt= ional hook,=C2=A0RetrieveInstrumentationCustomScan, to the=C2= =A0CustomExecMethods=C2=A0struct. This hook allows custom scan= providers to implement logic to collect and consolidate instrumentation fr= om shared memory or worker states during the parallel query cleanup phase. = This hook is invoked via the new=C2=A0ExecCustomScanRetrieveInstrumen= tation=C2=A0function, called from=C2=A0ExecParallelRetrieveIns= trumentation=C2=A0for=C2=A0T_CustomScanState=C2=A0nodes= . Since the hook is optional (checked for NULL before calling), it maintain= s full backward compatibility.

Testing & Compatibility:

  • The patch compiles and passes all core regression tests (make check-= world) on my x86_64 instance.
  • The changes are not platform-specific.
  • Regression Tests:=C2=A0This patch provides a new=C2=A0capability=C2=A0for custom scan providers. Since the hook's functionality is onl= y realized when implemented by an extension, specific tests would naturally= reside within that extension rather than in the core regression suite.

This patch does not directly address a specific item on the offici= al TODO list but enhances the extensibility framework.

I believ= e this patch is complete and ready for review. I look forward to any feedba= ck and am happy to make revisions. I will also add this patch to the next C= ommitFest.

Thank you,

Siddharth Kothari

--000000000000d963bc064eec2709--