Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery

From: Mats Kindahl <mats(at)timescale(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Hooking into ExplainOneQuery() complicated by missing standard_ExplainOneQuery
Date: 2024-03-04 11:59:46
Message-ID: CA+14427V_B4EAoC_o-iYYucRdMSOTfpuH9k-QbexffY1HYJBiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

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.

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.

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.

Best wishes,
Mats Kindahl, Timescale

Attachment Content-Type Size
v1-0001-Improve-support-for-ExplainOneQuery-hook.patch text/x-patch 5.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2024-03-04 12:07:58 Re: Shared detoast Datum proposal
Previous Message 'Alvaro Herrera' 2024-03-04 11:52:47 Re: Some shared memory chunks are allocated even if related processes won't start