Re: Question about ExplainOneQuery_hook

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Question about ExplainOneQuery_hook
Date: 2022-07-26 22:58:11
Message-ID: CAKFQuwYxgXi8JPozXBfeZfjf+_EUkDBEMAwhJG-U_qyFVYSisQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 26, 2022 at 1:54 PM Zhihong Yu <zyu(at)yugabyte(dot)com> wrote:

> Hi,
> I was looking at ExplainOneQuery() where ExplainOneQuery_hook is called.
>
> Currently the call to the hook is in if block and normal processing is in
> else block.
>
> What if the hook doesn't want to duplicate the whole code printing
> execution plan ?
>
> Please advise.
>
>
What kind of advice are you looking for, especially knowing we don't know
anything except you find the existing hook unusable.

https://github.com/postgres/postgres/commit/604ffd280b955100e5fc24649ee4d42a6f3ebf35

My advice is pretend the hook doesn't even exist since it was created 15
years ago for a specific purpose that isn't what you are doing.

I'm hoping that you already have some idea of how to interact with the open
source PostgreSQL project when it doesn't have a feature that you want.
Otherwise that generic discussion probably is best done on -general with a
better subject line.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-07-26 23:15:03 Re: Is RecoveryConflictInterrupt() entirely safe in a signal handler?
Previous Message David Rowley 2022-07-26 22:45:44 Re: Add proper planner support for ORDER BY / DISTINCT aggregates