Re: Push down more full joins in postgres_fdw - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Push down more full joins in postgres_fdw
Date
Msg-id d4767ed9-33d2-f392-6ce5-37d3d5ffd28e@lab.ntt.co.jp
Whole thread Raw
In response to Re: Push down more full joins in postgres_fdw  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: Push down more full joins in postgres_fdw  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Re: Push down more full joins in postgres_fdw  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
On 2016/10/27 18:06, Ashutosh Bapat wrote:
> On Thu, Oct 27, 2016 at 12:46 PM, Etsuro Fujita
> <fujita.etsuro@lab.ntt.co.jp> wrote:
>> On 2016/10/26 19:53, Ashutosh Bapat wrote:

>>> On Wed, Oct 26, 2016 at 3:35 PM, Etsuro Fujita
>>>> My concern about your proposal is: it might not be worth complicating the
>>>> code to solve a problem that is actually not a problem in practice.

>>> To me the current code looks complicated esp. because of the recursion
>>> involved and usage of out parameters to isSubqueryExpr().

>> I don't think so.  isSubqueryExpr is prety small, written in less than 50
>> lines, and the code looks rather simple to me.

>>> My
>>> suggestion goes inline with the current method of deparsing a Var.

>> Yeah, I think your approach makes it easy to search for the alias to a given
>> Var from the array you proposed.  I think the complexity of your approach
>> would be in extra work for building and maintaining the array while
>> deparsing the query.  I think that would probably need more invasive and
>> much larger changes to the existing code than what I proposed.
>>
>> I think this issue is optional, so I'd like to propose to leave this for the
>> committer's judge.

> Fine with me.

OK

Here is the updated version, which includes the restructuring you
proposed.  Other than the above issue and the alias issue we discussed,
I addressed all your comments except one on testing; I tried to add test
cases where the remote query is deparsed as nested subqueries, but I
couldn't because IIUC, reduce_outer_joins reduced full joins to inner
joins or left joins.  So, I added two test cases: (1) the joining
relations are both base relations (actually, we already have that) and
(2) one of the joining relations is a base relation and the other is a
join relation.  I rebased the patch to HEAD, so I added a test case with
aggregate pushdown also.

Best regards,
Etsuro Fujita

Attachment

pgsql-hackers by date:

Previous
From: Mithun Cy
Date:
Subject: Re: Proposal : For Auto-Prewarm.
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Patch to implement pg_current_logfile() function