Re: planstate_tree_walker oversight CustomScan

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: planstate_tree_walker oversight CustomScan
Date: 2015-09-23 01:14:30
Message-ID: CA+TgmoYWpSKrSa=Wm6vtRi6qphg1gNjqwp9kpano18OZZfHuow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 21, 2015 at 9:54 AM, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:
> The planstate_tree_walker() oversight custom_ps of CustomScanState;
> that should be a list of underlying PlanState object if any.
>
> ExplainPreScanNode() treated ForeignScan and CustomScan in special
> way (it is sufficient for ExplainPreScanNode() purpose), thus, it
> didn't implement its recursive portion originally.
>
> The job of ExplainPreScanNode() is know all the relids involved
> in a particular subquery execution. On the other hands, fs_relids
> of ForeignScan and custom_relids of CustomScan informs a set of
> relids to be scanned by this Scan node without recursive, so it
> did not have recursive walks on the underlying sub-plans.
>
> However, planstate_tree_walker() will have different expectation.
> It is general walker routine, thus, it is natural users to expect
> the callback is also kicked towards the underlying planstate of
> CustomScan (and ForeignScan; once EPQ recheck gets solved).
>
> The attached patch adds support of CustomScan on the walker.

Do you need to add something to ExplainPreScanNode for this as well,
like if (scanrelid != 0) *rels_used = bms_add_member(*rels_used,
scanrelid)?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-09-23 01:18:43 Re: Parallel Seq Scan
Previous Message Kouhei Kaigai 2015-09-23 01:12:28 Re: Parallel Seq Scan