pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Provide a planner hook at a suitable place for creating upper-re
Date: Mon, 14 Mar 2016 23:23:36 +0000
Message-ID: <E1afbpo-0003Gf-UU@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Provide a planner hook at a suitable place for creating upper-rel Paths.

In the initial revision of the upper-planner pathification work, the only
available way for an FDW or custom-scan provider to inject Paths
representing post-scan-join processing was to insert them during scan-level
GetForeignPaths or similar processing.  While that's not impossible, it'd
require quite a lot of duplicative processing to look forward and see if
the extension would be capable of implementing the whole query.  To improve
matters for custom-scan providers, provide a hook function at the point
where the core code is about to start filling in upperrel Paths.  At this
point Paths are available for the whole scan/join tree, which should reduce
the amount of redundant effort considerably.

(An alternative design that was suggested was to provide a separate hook
for each post-scan-join processing step, but that seems messy and not
clearly more useful.)

Following our time-honored tradition, there's no documentation for this
hook outside the source code.

As-is, this hook is only meant for custom scan providers, which we can't
assume very much about.  A followon patch will implement an FDW callback
to let FDWs do the same thing in a somewhat more structured fashion.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5864d6a4b62ada2ad60a8c456b4ee62972a9c10d

Modified Files
--------------
src/backend/optimizer/plan/planner.c      | 26 ++++++++++++++++++++++++++
src/backend/optimizer/prep/prepjointree.c |  1 +
src/include/nodes/relation.h              |  3 +++
src/include/optimizer/planner.h           |  5 +++++
4 files changed, 35 insertions(+)


-- 
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: <E1afbpo-0003Gf-UU@gemulon.postgresql.org>
Permalink:  ../E1afbpo-0003Gf-UU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1afbpo-0003Gf-UU@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Provide a planner hook at a suitable place for creating upper-re
  In-Reply-To: <E1afbpo-0003Gf-UU@gemulon.postgresql.org>
  References: <E1afbpo-0003Gf-UU@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