How and at what stage to stop FDW to generate plan with JOIN.

From: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp
Subject: How and at what stage to stop FDW to generate plan with JOIN.
Date: 2019-04-23 19:22:25
Message-ID: CALtqXTfXTjkgQMAinfDYDn-8uHUsCrh=JNS+o+ydJxVQMv2R8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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.

tpch=# select

l_orderkey,

sum(l_extendedprice * (1 - l_discount)) as revenue,

o_orderdate,

o_shippriority

from

customer,

orders,

lineitem

where

c_mktsegment = 'BUILDING'

and c_custkey = o_custkey

and l_orderkey = o_orderkey

and o_orderdate < date '1995-03-22'

and l_shipdate > date '1995-03-22'

group by

l_orderkey,

o_orderdate,

o_shippriority

order by

revenue,

o_orderdate

LIMIT 10;

QUERY PLAN

...

Merge Cond: (orders.o_orderkey = lineitem.l_orderkey)

-> Foreign Scan (cost=1.00..-1.00 rows=1000 width=50)

Output: orders.o_orderdate, orders.o_shippriority, orders.o_orderkey

Relations: (customer) INNER JOIN (orders)

Remote SQL: SELECT r2.o_orderdate, r2.o_shippriority, r2.o_orderkey
FROM db.customer
r1 ALL INNER JOIN db.orders r2 ON (((r1.c_custkey = r2.o_custkey)) AND
((r2.o_orderdate < '1995-03-22')) AND ((r1.c_mktsegment = 'BUILDING')))
ORDER BY r2.o_orderkey, r2.o_orderdate, r2.o_shippriority

...

--

Ibrar Ahmed

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-23 20:05:59 Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Previous Message Adam Brusselback 2019-04-23 19:12:27 Re: block-level incremental backup