Re: Foreign Join pushdowns not working properly for outer joins

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign Join pushdowns not working properly for outer joins
Date: 2017-03-06 05:51:01
Message-ID: 770319a3-b6b7-f7e1-95f3-51a405c24a8c@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017/03/06 11:05, David Rowley wrote:
> I've been asked to investigate a case of a foreign join not occurring
> on the foreign server as would have been expected.

> The attached patch, based on 9.6, fixes the problem by properly
> processing the foreign server options in
> postgresGetForeignJoinPaths().
>
> I ended up shifting the code which does this into functions to allow
> it to be reused. I also ended up shifting out the code which processes
> the table options so that it is consistent.
>
> Reviews from people a bit closer to the foreign join pushdown code are welcome.

Thanks for working on this!

I think the fix would work well, but another way I think is much simpler
and more consistent with the existing code is to (1) move code for
getting the server info from the outer's fpinfo before calling
is_foreign_expr() in foreign_join_ok() and (2) add code for getting the
shippable extensions info from the outer's fpinfo before calling that
function, like the attached.

Best regards,
Etsuro Fujita

Attachment Content-Type Size
foreign_outerjoin_pushdown_fix_efujita.patch binary/octet-stream 899 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rafia Sabih 2017-03-06 06:22:03 TPC-H Q20 from 1 hour to 19 hours!
Previous Message Amit Langote 2017-03-06 05:50:28 Re: dropping partitioned tables without CASCADE