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

From Ibrar Ahmed
Subject How and at what stage to stop FDW to generate plan with JOIN.
Date
Msg-id CALtqXTfXTjkgQMAinfDYDn-8uHUsCrh=JNS+o+ydJxVQMv2R8A@mail.gmail.com
Whole thread Raw
In response to Minor postmaster state machine bugs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How and at what stage to stop FDW to generate plan with JOIN.
List 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



pgsql-hackers by date:

Previous
From: Adam Brusselback
Date:
Subject: Re: block-level incremental backup
Next
From: Tom Lane
Date:
Subject: Re: Calling PrepareTempTablespaces in BufFileCreateTemp