postgresql/contrib/postgres_fdw
Robert Haas f18c944b61 postgres_fdw: Add ORDER BY to some remote SQL queries.
If the join problem's entire ORDER BY clause can be pushed to the
remote server, consider a path that adds this ORDER BY clause.  If
use_remote_estimate is on, we cost this path using an additional
remote EXPLAIN.  If not, we just estimate that the path costs 20%
more, which is intended to be large enough that we won't request a
remote sort when it's not helpful, but small enough that we'll have
the remote side do the sort when in doubt.  In some cases, the remote
sort might actually be free, because the remote query plan might
happen to produce output that is ordered the way we need, but without
remote estimates we have no way of knowing that.

It might also be useful to request sorted output from the remote side
if it enables an efficient merge join, but this patch doesn't attempt
to handle that case.

Ashutosh Bapat with revisions by me.  Also reviewed by Fabrízio de Royes
Mello and Jeevan Chalke.
2015-11-03 13:04:42 -05:00
..
expected postgres_fdw: Add ORDER BY to some remote SQL queries. 2015-11-03 13:04:42 -05:00
sql postgres_fdw: Add ORDER BY to some remote SQL queries. 2015-11-03 13:04:42 -05:00
.gitignore
connection.c Create an infrastructure for parallel computation in PostgreSQL. 2015-04-30 15:02:14 -04:00
deparse.c postgres_fdw: Add ORDER BY to some remote SQL queries. 2015-11-03 13:04:42 -05:00
Makefile Fix SHLIB_PREREQS use in contrib, allowing PGXS builds 2014-12-04 07:58:12 -05:00
option.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
postgres_fdw--1.0.sql
postgres_fdw.c postgres_fdw: Add ORDER BY to some remote SQL queries. 2015-11-03 13:04:42 -05:00
postgres_fdw.control
postgres_fdw.h postgres_fdw: Add ORDER BY to some remote SQL queries. 2015-11-03 13:04:42 -05:00