Re: EXPLAIN Verbose issue - custom_scan_tlist can directly refer CTE and Subquery - Mailing list pgsql-bugs

From Lepikhov Andrei
Subject Re: EXPLAIN Verbose issue - custom_scan_tlist can directly refer CTE and Subquery
Date
Msg-id 545bcd8f-7789-4054-bea1-44e2584a305a@app.fastmail.com
Whole thread Raw
In response to Re: EXPLAIN Verbose issue - custom_scan_tlist can directly refer CTE and Subquery  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-bugs

On Mon, Sep 11, 2023, at 1:28 PM, Richard Guo wrote:
> Maybe we can use the first plan in CustomScan->custom_plans as the INNER
> referent?  I'm not sure.
After some exploration of ruleutils.c I grasped more on this issue.
If we have come to the CTE or SubPlan entry by the INDEX_VAR link from custom_scan_tlist, we don't have any information
onwhich subplan to go further (entry info already removed because of optimization).
 
To find a specific subplan, we must pass through the custom node subtree and find CteScan or SubqueryScan, whose target
listrefers to this entry. After that, we can go into the subplan to correctly explain the var.
 
It looks like a lot of work. One vague idea is to change set_customscan_references and wrap up CustomScan with useful
data.
Or, maybe it is better not to try to go under the custom_scan_tlist and explain CTE and Subquery right on the level of
theCustomScan?
 

-- 
Regards,
Andrei Lepikhov



pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #18046: stats collection behaviour change is affecting the usability of information.
Next
From: PG Bug reporting form
Date:
Subject: BUG #18107: "policy ... for table ... already exists" errors when restore postgres database from dump