Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
Subject: Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)
Date: 2016-02-04 09:58:50
Message-ID: 56B320DA.4080405@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/02/04 17:58, Etsuro Fujita wrote:
> On 2016/02/04 8:00, Robert Haas wrote:
>> On Wed, Feb 3, 2016 at 5:56 PM, Robert Haas <robertmhaas(at)gmail(dot)com>
>> wrote:
>>> On Wed, Feb 3, 2016 at 12:08 PM, Ashutosh Bapat
>>> <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
>>>> PFA patches with naming conventions similar to previous ones.
>>>> pg_fdw_core_v7.patch: core changes
>>>> pg_fdw_join_v7.patch: postgres_fdw changes for join pushdown
>>>> pg_join_pd_v7.patch: combined patch for ease of testing.

One more: I think the following in postgresGetForeignJoinPaths() is a
good idea, but I think it's okay to just check whether root->rowMarks is
non-NIL, because that since we have rowmarks for all base relations
except the target, if we have root->parse->commandType==CMD_DELETE (or
root->parse->commandType==CMD_UPDATE), then there would be at least one
non-target base relation in the joinrel, which would have a rowmark.

+ if (root->parse->commandType == CMD_DELETE ||
+ root->parse->commandType == CMD_UPDATE ||
+ root->rowMarks)
+ {
+ epq_path = GetPathForEPQRecheck(joinrel);
+ if (!epq_path)
+ {
+ elog(DEBUG3, "could not push down foreign join because a local path
suitable for EPQ checks was not found");
+ return;
+ }
+ }

Best regards,
Etsuro Fujita

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-02-04 09:59:03 Re: In-core regression tests for replication, cascading, archiving, PITR, etc.
Previous Message Alvaro Herrera 2016-02-04 09:58:06 Re: pgbench stats per script & other stuff