pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: a.rybakina <a.rybakina@postgrespro.ru>
To: Lepikhov Andrei <lepikhov@fastmail.com>
Cc: pgsql-bugs@lists.postgresql.org, Дамир Белялов <d.belyalov@postgrespro.ru>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
Subject: Re: EXPLAIN Verbose issue - custom_scan_tlist can directly refer CTE and Subquery
Date: Tue, 10 Oct 2023 17:01:54 +0300
Message-ID: <b6292f36-8856-4cd4-9d6c-ba995a19992f@postgrespro.ru> (raw)
In-Reply-To: <0cbbd87e-1b57-4b7e-9825-19a6fb2f8670@postgrespro.ru>
References: <dfe47e78-f9c3-4f59-a345-591f7fd3ceec@app.fastmail.com>
	<CAMbWs49A1VegrUX08on3WdH7b7t7FUE15JT4qk_vsQ_qfHMGhQ@mail.gmail.com>
	<ca3f78bc-9775-4c12-97b5-5e03282df3ea@postgrespro.ru>
	<0cbbd87e-1b57-4b7e-9825-19a6fb2f8670@postgrespro.ru>

On 09.10.2023 11:41, Andrei Lepikhov wrote:
> After some attempts to resolve this issue, I must admit that we should 
> add a non-trivial method in the CustomScan node interface, which would 
> be called in the ruleutils code.
> I guess it is too much for such a rare situation. So maybe just add a 
> documentation entry on this thing and set a couple of assertions on 
> early detection of problems?.
> In the attachment - is an offer on how to change the code.
>
Hi!

I have studied the problem and I agree with your suggestion to disable 
the possibility of explaining subqueries in CustomNode for now.

So far I can only find information about HashJoin and ValueScan, but I 
expected that this is not what is needed.

(gdb) p *((Plan *)(cscan->custom_plans->elements[0].ptr_value))->lefttree
$29 = {type = T_ValuesScan, startup_cost = 0, total_cost = 
0.025000000000000001, plan_rows = 2, plan_width = 4, parallel_aware = 
false, parallel_safe = true, async_capable = false, plan_node_id = 0,
   targetlist = 0x560fc9979398, qual = 0x0, lefttree = 0x0, righttree = 
0x0, initPlan = 0x0, extParam = 0x0, allParam = 0x0}
(gdb) p *((Plan *)(cscan->custom_plans->elements[0].ptr_value))
$30 = {type = T_HashJoin, startup_cost = 0.050000000000000003, 
total_cost = 0.10250000000000001, plan_rows = 2, plan_width = 32, 
parallel_aware = false, parallel_safe = false, async_capable = false,
   plan_node_id = 0, targetlist = 0x560fc9979208, qual = 0x0, lefttree = 
0x560fc9979438, righttree = 0x560fc9979958, initPlan = 0x0, extParam = 
0x0, allParam = 0x0}
(gdb) p *((Plan *)(cscan->custom_plans->elements[0].ptr_value))->righttree
$31 = {type = T_Hash, startup_cost = 0.025000000000000001, total_cost = 
0.025000000000000001, plan_rows = 2, plan_width = 32, parallel_aware = 
false, parallel_safe = false, async_capable = false,
   plan_node_id = 0, targetlist = 0x560fc9979518, qual = 0x0, lefttree = 
0x560fc9979698, righttree = 0x0, initPlan = 0x0, extParam = 0x0, 
allParam = 0x0}
(gdb) p *((Plan *)(cscan->custom_plans->elements[0].ptr_value))->lefttree
$32 = {type = T_ValuesScan, startup_cost = 0, total_cost = 
0.025000000000000001, plan_rows = 2, plan_width = 4, parallel_aware = 
false, parallel_safe = true, async_capable = false, plan_node_id = 0,
   targetlist = 0x560fc9979398, qual = 0x0, lefttree = 0x0, righttree = 
0x0, initPlan = 0x0, extParam = 0x0, allParam = 0x0}

view thread (7+ messages)

Message-ID: <b6292f36-8856-4cd4-9d6c-ba995a19992f@postgrespro.ru>
Permalink:  ../b6292f36-8856-4cd4-9d6c-ba995a19992f@postgrespro.ru/
Also on:    postgresql.org/message-id/b6292f36-8856-4cd4-9d6c-ba995a19992f@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: a.rybakina@postgrespro.ru, lepikhov@fastmail.com, d.belyalov@postgrespro.ru, guofenglinux@gmail.com, a.lepikhov@postgrespro.ru
  Subject: Re: EXPLAIN Verbose issue - custom_scan_tlist can directly refer CTE and Subquery
  In-Reply-To: <b6292f36-8856-4cd4-9d6c-ba995a19992f@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox