From e4106b2528727c4b48639c0e12bf2f70a766b910 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 9 Feb 2016 14:00:50 -0500 Subject: postgres_fdw: Push down joins to remote servers. If we've got a relatively straightforward join between two tables, this pushes that join down to the remote server instead of fetching the rows for each table and performing the join locally. Some cases are not handled yet, such as SEMI and ANTI joins. Also, we don't yet attempt to create presorted join paths or parameterized join paths even though these options do get tried for a base relation scan. Nevertheless, this seems likely to be a very significant win in many practical cases. Shigeru Hanada and Ashutosh Bapat, reviewed by Robert Haas, with additional review at various points by Tom Lane, Etsuro Fujita, KaiGai Kohei, and Jeevan Chalke. --- doc/src/sgml/postgres-fdw.sgml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml index a90983cb1e9..c408ba659bc 100644 --- a/doc/src/sgml/postgres-fdw.sgml +++ b/doc/src/sgml/postgres-fdw.sgml @@ -486,6 +486,16 @@ be IMMUTABLE as well. + + When postgres_fdw encounters a join between foreign tables on + the same foreign server, it sends the entire join to the foreign server, + unless for some reason it believes that it will be more efficient to fetch + rows from each table individually, or unless the table references involved + are subject to different user mappings. While sending the JOIN + clauses, it takes the same precautions as mentioned above for the + WHERE clauses. + + The query that is actually sent to the remote server for execution can be examined using EXPLAIN VERBOSE. -- cgit v1.2.3