Re: Push down more full joins in postgres_fdw

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Push down more full joins in postgres_fdw
Date: 2016-09-28 09:20:05
Message-ID: c73e2a65-b851-bd2c-e6b6-2a7d5f5fbdbf@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/09/27 13:33, Ashutosh Bapat wrote:

I wrote:
>>>>>> ISTM that the use of the same RTI for subqueries in multi-levels in a
>>>>>> remote
>>>>>> SQL makes the SQL a bit difficult to read. How about using the
>>>>>> position
>>>>>> of
>>>>>> the join rel in join_rel_list, (more precisely, the position plus
>>>>>> list_length(root->parse->rtable)), instead?

I wrote:
>> The join rel is appended to the end of the list, so I was thinking to get
>> the position info by list_length during postgresGetForeignJoinPaths.

> That's true only when the paths are being added to a newly created
> joinrel. But that's not true always. We may add paths with different
> joining order to an existing joinrel, in which case list_length would
> not give its position. Am I missing something?

I think you are right, but postgresGetForeignJoinPaths only allows us to
add a foreign join path to a newly created joinrel. The reason is
because that routine skips all its work after the first call for that
joinrel, by checking to see if joinrel->fdw_private is not NULL. So, I
think it's reasonable to get the position by list_length in that routine.

Best regards,
Etsuro Fujita

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-09-28 09:25:43 Re: Password identifiers, protocol aging and SCRAM protocol
Previous Message Michael Paquier 2016-09-28 08:14:41 Re: Quorum commit for multiple synchronous replication.