Re: How and at what stage to stop FDW to generate plan with JOIN. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How and at what stage to stop FDW to generate plan with JOIN.
Date
Msg-id 17065.1556050511@sss.pgh.pa.us
Whole thread Raw
In response to How and at what stage to stop FDW to generate plan with JOIN.  (Ibrar Ahmed <ibrar.ahmad@gmail.com>)
Responses Re: How and at what stage to stop FDW to generate plan with JOIN.
List pgsql-hackers
Ibrar Ahmed <ibrar.ahmad@gmail.com> writes:
> I am working on an FDW where the database does not support any operator
> other than "=" in JOIN condition. Some queries are genrating the plan with
> JOIN having "<" operator. How and at what stage I can stop FDW to not make
> such a plan. Here is my sample query.

What exactly do you think should happen instead?  You can't just tell
users not to ask such a query.  (Well, you can try, but they'll probably
go looking for a less broken FDW.)

If what you really mean is you don't want to generate pushed-down
foreign join paths containing non-equality conditions, the answer is
to just not do that.  That'd be the FDW's own fault, not that of
the core planner, if it creates a path representing a join it
can't actually implement.  You'll end up running the join locally,
which might not be great, but if you have no other alternative
then that's what you gotta do.

If what you mean is you don't know how to inspect the join quals
to see if you can implement them, take a look at postgres_fdw
to see how it handles the same issue.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Trouble with FETCH_COUNT and combined queries in psql
Next
From: Ibrar Ahmed
Date:
Subject: Re: How and at what stage to stop FDW to generate plan with JOIN.