Re: Foreign join pushdown vs EvalPlanQual - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Foreign join pushdown vs EvalPlanQual
Date
Msg-id 560DFF4E.2000001@lab.ntt.co.jp
Whole thread Raw
In response to Re: Foreign join pushdown vs EvalPlanQual  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Foreign join pushdown vs EvalPlanQual
List pgsql-hackers
On 2015/10/02 9:50, Kyotaro HORIGUCHI wrote:
>> As long as FDW author can choose their best way to produce a joined
>> tuple, it may be worth to investigate.
>>
>> My comments are:
>> * ForeignRecheck is the best location to call RefetchForeignJoinRow
>>    when scanrelid==0, not ExecScanFetch. Why you try to add special
>>    case for FDW in the common routine.

In my understanding, the job that ExecScanRecheckMtd should do is to 
check if the test tuple *already stored* in the plan node's scan slot 
meets the access-method conditions, in general.  So, ISTM that it'd be
somewhat odd to replace RefetchForeignJoinRow within ForeignRecheck, to 
store the remote join tuple in the slot.  Also, RefetchForeignRow is 
called from the common routines ExecLockRows/EvalPlanQualFetchRowMarks ...

>> * It is FDW's choice where the remote join tuple is kept, even though
>>    most of FDW will keep it on the private field of ForeignScanState.

I see.

To make it possible that the FDW doesn't have to do anything for cases 
where the FDW doesn't do any late row locking, however, I think it'd be 
more promising to use the remote join tuple stored in the scan slot of 
the corresponding ForeignScanState node in the parent's planstate tree.  I haven't had a good idea for that yet,
though.

> EvalPlanQualFetchRowMarks fetches the possiblly
> modified row then EvalPlanQualNext does recheck for the new
> row.

Really?  EvalPlanQualFetchRowMarks fetches the tuples for any non-locked 
relations, so I think that that function should fetch the same version 
previously obtained for each such relation successfully.

Best regards,
Etsuro Fujita




pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: Foreign join pushdown vs EvalPlanQual
Next
From: Etsuro Fujita
Date:
Subject: Re: Typo in /src/backend/optimizer/README