Re: RFC: Logging plan of the running query - Mailing list pgsql-hackers

From torikoshia
Subject Re: RFC: Logging plan of the running query
Date
Msg-id ac6c51071316279bf903078cf264c37a@oss.nttdata.com
Whole thread Raw
In response to Re: RFC: Logging plan of the running query  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: RFC: Logging plan of the running query  (Robert Haas <robertmhaas@gmail.com>)
Re: RFC: Logging plan of the running query  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
On Fri, Feb 16, 2024 at 11:42 PM torikoshia <torikoshia@oss.nttdata.com> 
wrote:
> I'm not so sure about the implementation now, i.e. finding the next 
> node
> to be executed from the planstate tree, but I'm going to try this
> approach.

Attached a patch which takes this approach.

- I saw no way to find the next node to be executed from the planstate 
tree, so the patch wraps all the ExecProcNode of the planstate tree at 
CHECK_FOR_INTERRUPTS().
- To prevent overhead of this wrapped function call, unwrap it at the 
end of EXPLAIN code execution.
- I first tried to use ExecSetExecProcNode() for wrapping, but it 
'changes' ExecProcNodeMtd of nodes, not 'adds' some process to 
ExecProcNodeMtd. I'm not sure this is the right approach, but attached 
patch adds new member ExecProcNodeOriginal to PlanState to preserve 
original ExecProcNodeMtd.

Any comments are welcomed.

-- 
Regards,

--
Atsushi Torikoshi
NTT DATA Group Corporation
Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: A failure in t/038_save_logical_slots_shutdown.pl
Next
From: Michael Paquier
Date:
Subject: Re: Add new error_action COPY ON_ERROR "log"