From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Yuzuko Hosoya <hosoya.yuzuko@lab.ntt.co.jp>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Runtime pruning problem
Date: Wed, 17 Apr 2019 00:10:14 -0400
Message-ID: <2923.1555474214@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f9ch8rVy8ZhsV2J7q0zCq4xFuXWxTT90EadpkTsgCvQQw@mail.gmail.com>
References: <001001d4f44b$2a2cca50$7e865ef0$@lab.ntt.co.jp>
<CAKJS1f_4b9J7K7DSuZMkyga67OetfyAWz1xzYJd25HSf9-cijQ@mail.gmail.com>
<b50238ec-e402-6fcb-7f3a-b74418471b29@lab.ntt.co.jp>
<CAKJS1f98o-6-SWWzcfiJO6JAQFu2DnYWBzFVB0x2+u5ub=ASEA@mail.gmail.com>
<c4acce90-8265-c91f-065f-e4507ad054bd@lab.ntt.co.jp>
<2018.1555473241@sss.pgh.pa.us>
<CAKJS1f9ch8rVy8ZhsV2J7q0zCq4xFuXWxTT90EadpkTsgCvQQw@mail.gmail.com>
David Rowley <david.rowley@2ndquadrant.com> writes:
> On Wed, 17 Apr 2019 at 15:54, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> What I'm more worried about is whether this breaks any internal behavior
>> of explain.c, as the comment David quoted upthread seems to think.
>> If we need to have a tlist to reference, can we make that code look
>> to the pre-pruning plan tree, rather than the planstate tree?
> I think most of the complexity is in what to do in
> set_deparse_planstate() given that there might be no outer plan to
> choose from for Append and MergeAppend. This controls what's done in
> resolve_special_varno() as this descends the plan tree down the outer
> side until it gets to the node that the outer var came from.
> We wouldn't need to do this if we just didn't show the targetlist in
> EXPLAIN VERBOSE, but there's also MergeAppend sort keys to worry about
> too. Should we just skip on those as well?
No, the larger issue is that *any* plan node above the Append might
be recursing down to/through the Append to find out what to print for
a Var reference. We have to be able to support that.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, hosoya.yuzuko@lab.ntt.co.jp, pgsql-hackers@lists.postgresql.org
Subject: Re: Runtime pruning problem
In-Reply-To: <2923.1555474214@sss.pgh.pa.us>
* 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