pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Generate a separate upper relation for each stage of setop plann
Date: Mon, 19 Mar 2018 15:57:25 +0000
Message-ID: <E1exxA5-0002cY-E4@gemulon.postgresql.org> (raw)

Generate a separate upper relation for each stage of setop planning.

Commit 3fc6e2d7f5b652b417fa6937c34de2438d60fa9f made setop planning
stages return paths rather than plans, but all such paths were loosely
associated with a single RelOptInfo, and only the final path was added
to the RelOptInfo.  Even at the time, it was foreseen that this should
be changed, because there is otherwise no good way for a single stage
of setop planning to return multiple paths.  With this patch, each
stage of set operation planning now creates a separate RelOptInfo;
these are distinguished by using appropriate relid sets.  Note that
this patch does nothing whatsoever about actually returning multiple
paths for the same set operation; it just makes it possible for a
future patch to do so.

Along the way, adjust things so that create_upper_paths_hook is called
for each of these new RelOptInfos rather than just once, since that
might be useful to extensions using that hook.  It might be a good
to provide an FDW API here as well, but I didn't try to do that for
now.

Patch by me, reviewed and tested by Ashutosh Bapat and Rajkumar
Raghuwanshi.

Discussion: http://postgr.es/m/CA+TgmoaLRAOqHmMZx=ESM3VDEPceg+-XXZsRXQ8GtFJO_zbMSw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c596fadbfe20ff50a8e5f4bc4b4ff5b7c302ecc0

Modified Files
--------------
src/backend/optimizer/prep/prepunion.c | 340 ++++++++++++++++++---------------
1 file changed, 190 insertions(+), 150 deletions(-)



Message-ID: <E1exxA5-0002cY-E4@gemulon.postgresql.org>
Permalink:  ../E1exxA5-0002cY-E4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1exxA5-0002cY-E4@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: Generate a separate upper relation for each stage of setop plann
  In-Reply-To: <E1exxA5-0002cY-E4@gemulon.postgresql.org>
  References: <E1exxA5-0002cY-E4@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