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@lists.postgresql.org
Subject: pgsql: Build "other rels" of appendrel baserels in a separate step.
Date: Tue, 26 Mar 2019 22:21:18 +0000
Message-ID: <E1h8uRa-0004Wb-0X@gemulon.postgresql.org> (raw)

Build "other rels" of appendrel baserels in a separate step.

Up to now, otherrel RelOptInfos were built at the same time as baserel
RelOptInfos, thanks to recursion in build_simple_rel().  However,
nothing in query_planner's preprocessing cares at all about otherrels,
only baserels, so we don't really need to build them until just before
we enter make_one_rel.  This has two benefits:

* create_lateral_join_info did a lot of extra work to propagate
lateral-reference information from parents to the correct children.
But if we delay creation of the children till after that, it's
trivial (and much harder to break, too).

* Since we have all the restriction quals correctly assigned to
parent appendrels by this point, it'll be possible to do plan-time
pruning and never make child RelOptInfos at all for partitions that
can be pruned away.  That's not done here, but will be later on.

Amit Langote, reviewed at various times by Dilip Kumar, Jesper Pedersen,
Yoshikazu Imai, and David Rowley

Discussion: https://postgr.es/m/9d7c5112-cb99-6a47-d3be-cf1ee6862a1d@lab.ntt.co.jp

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/53bcf5e3dbeaed5baf9d09b124cf196d247c54ea

Modified Files
--------------
src/backend/optimizer/path/allpaths.c  |   2 +-
src/backend/optimizer/plan/initsplan.c |  94 ++++++++++-------------
src/backend/optimizer/plan/planmain.c  |  24 ++++--
src/backend/optimizer/util/relnode.c   | 132 ++++++++++++++++++++++-----------
src/include/optimizer/pathnode.h       |   2 +
src/include/optimizer/planmain.h       |   1 +
6 files changed, 150 insertions(+), 105 deletions(-)



Message-ID: <E1h8uRa-0004Wb-0X@gemulon.postgresql.org>
Permalink:  ../E1h8uRa-0004Wb-0X@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h8uRa-0004Wb-0X@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: Build "other rels" of appendrel baserels in a separate step.
  In-Reply-To: <E1h8uRa-0004Wb-0X@gemulon.postgresql.org>
  References: <E1h8uRa-0004Wb-0X@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