pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: postgres_fdw: Consider requesting sorted data so we can do a mer
Date: Tue, 22 Dec 2015 18:54:26 +0000
Message-ID: <E1aBS4o-0002l1-Tv@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

postgres_fdw: Consider requesting sorted data so we can do a merge join.

When use_remote_estimate is enabled, consider adding ORDER BY to the
query we sending to the remote server so that we can use that ordered
data for a merge join.  Commit f18c944b6137329ac4a6b2dce5745c5dc21a8578
arranges to push down the query pathkeys, which seems like the case
mostly likely to be a win, but testing shows this can sometimes win,
too.

For a regular table, we know which indexes are present and therefore
test whether the ordering provided by each such index is useful.  Here,
we take the opposite approach: guess what orderings would be useful if
they could be generated cheaply, and then ask the remote side what those
will cost.

Ashutosh Bapat, with very substantial cosmetic revisions by me.  Also
reviewed by Rushabh Lathia.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ccd8f97922944566d26c7d90eb67ab7848ee9905

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out |  165 ++++++++++++++++
contrib/postgres_fdw/postgres_fdw.c            |  238 ++++++++++++++++++++----
contrib/postgres_fdw/sql/postgres_fdw.sql      |   40 ++++
src/backend/optimizer/path/pathkeys.c          |    5 +-
src/include/optimizer/paths.h                  |    3 +
5 files changed, 410 insertions(+), 41 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1aBS4o-0002l1-Tv@gemulon.postgresql.org>
Permalink:  ../E1aBS4o-0002l1-Tv@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aBS4o-0002l1-Tv@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: postgres_fdw: Consider requesting sorted data so we can do a mer
  In-Reply-To: <E1aBS4o-0002l1-Tv@gemulon.postgresql.org>
  References: <E1aBS4o-0002l1-Tv@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox