From: | Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Oddity in EXPLAIN for foreign/custom join pushdown plans |
Date: | 2016-07-27 03:20:48 |
Message-ID: | 6cf472ee-1472-8084-8d3c-b2b48de9ac6c@lab.ntt.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I noticed that currently the core doesn't show any information on the
target relations involved in a foreign/custom join in EXPLAIN, by
itself. Here is an example:
-- join two tables
EXPLAIN (COSTS false, VERBOSE)
SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY
t1.c3, t1.c1 OFFSET 100 LIMIT 10;
QUERY PLAN \
-------------------------------------------------------------------------------------------------------------------------------------------------------\
-----------------------------------
Limit
Output: t1.c1, t2.c1, t1.c3
-> Foreign Scan
Output: t1.c1, t2.c1, t1.c3
Relations: (public.ft1 t1) INNER JOIN (public.ft2 t2)
Remote SQL: SELECT r1."C 1", r1.c3, r2."C 1" FROM ("S 1"."T
1" r1 INNER JOIN "S 1"."T 1" r2 ON (((r1."C 1" = r2."C 1")))) ORDER BY
r1.c3 ASC N\
ULLS LAST, r1."C 1" ASC NULLS LAST
(6 rows)
postgres_fdw shows the target relations in the Relations line, as shown
above, but I think that the core should show such information
independently of FDWs; in the above example replace "Foreign Scan" with
"Foreign Join on public.ft1 t1, public.ft2 t2". Please find attached a
patch for that. Comments welcome!
Best regards,
Etsuro Fujita
Attachment | Content-Type | Size |
---|---|---|
explain-for-foreign-custom-join-pushdown.patch | binary/octet-stream | 56.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2016-07-27 03:45:12 | Re: Why we lost Uber as a user |
Previous Message | Joshua D. Drake | 2016-07-27 03:00:47 | Re: to_date_valid() |