Re: Foreign Join pushdowns not working properly for outer joins

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign Join pushdowns not working properly for outer joins
Date: 2017-04-14 04:24:18
Message-ID: CAFjFpRd1fbtHWMg25xV4PHPfzrJt34y6Qe2YQMa_4BU6mYdWEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 13, 2017 at 7:35 AM, David Rowley
<david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> On 13 April 2017 at 11:22, Peter Eisentraut
> <peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>> Is this patch considered ready for review as a backpatch candidate?
>
> Yes, however, the v5 patch is based on master. The v4 patch should
> apply to 9.6. Diffing the two patches I see another tiny change to a
> comment, of which I think needs re-worded anyway.
>
> + * This function should usually set FDW options in fpinfo after the join is
> + * deemed safe to push down to save some CPU cycles. But We need server
> + * specific options like extensions to decide push-down safety. For
> + * checking extension shippability, we need foreign server as well.
> + */
>
> This might be better written as:
>
> Ordinarily, we might be tempted into delaying the merging of the FDW
> options until we've deemed the foreign join to be ok. However, we must
> do this before performing this test so that we know which quals can be
> evaluated on the foreign server. This may depend on the
> shippable_extensions.
>

This looks better. Here are patches for master and 9.6.
Since join pushdown was supported in 9.6 the patch should be
backported to 9.6 as well. Attached is the patch (_96) for 9.6,
created by rebasing on 9.6 branch and removing conflict. _v6 is
applicable on master.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

Attachment Content-Type Size
foreign_outerjoin_pushdown_fix_96.patch application/octet-stream 12.9 KB
foreign_outerjoin_pushdown_fix_v6.patch application/octet-stream 14.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-04-14 04:51:15 Re: Tuplesort merge pre-reading
Previous Message Amit Langote 2017-04-14 04:14:21 Re: Logical replication and inheritance