Re: LATERAL - Mailing list pgsql-hackers

From Robert Haas
Subject Re: LATERAL
Date
Msg-id 603c8f070912192006q768f6d36wfa0cf90a10429049@mail.gmail.com
Whole thread Raw
In response to Re: LATERAL  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: LATERAL
Re: LATERAL
List pgsql-hackers
On Sat, Dec 19, 2009 at 11:01 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Sat, Dec 19, 2009 at 4:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> On Sat, Dec 19, 2009 at 3:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> I believe the correct approach is probably to treat values that need to
>>>> be propagated into the inner side as executor parameters.  This could
>>>> replace the existing, rather crocky, management of values passed into a
>>>> nestloop inner indexscan.
>>
>>> What is the best place to look for the existing, rather crocky code?
>>
>> Follow the second argument of ExecReScan from nodeNestloop to
>> nodeIndexscan.
>
> Yeah, this is grotty.  It appears that the comment introducing
> ExecReScan() is somewhat incorrect.  It asserts that exprCtxt is used
> only

Sigh.

...is used only for index scans.  However, it's actually also used for
bitmap scans (both heap and index) and TID scans.  Also, there appears
to be an effort by nodes that don't use exprCtxt directly to propagate
down through the node tree, which doesn't seem to make much sense if
this is only intended to be used on the inner side of a nestloop.

...Robert


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: LATERAL
Next
From: Tom Lane
Date:
Subject: Re: LATERAL