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: Get rid of duplicate child RTE for a partitioned table.
Date: Tue, 26 Mar 2019 16:03:35 +0000
Message-ID: <E1h8oY3-0005Nt-F3@gemulon.postgresql.org> (raw)

Get rid of duplicate child RTE for a partitioned table.

We've been creating duplicate RTEs for partitioned tables just
because we do so for regular inheritance parent tables.  But unlike
regular-inheritance parents which are themselves regular tables
and thus need to be scanned, partitioned tables don't need the
extra RTE.

This makes the conditions for building a child RTE the same as those
for building an AppendRelInfo, allowing minor simplification in
expand_single_inheritance_child.  Since the planner's actual processing
is driven off the AppendRelInfo list, nothing much changes beyond that,
we just have one fewer useless RTE entry.

Amit Langote, reviewed and hacked a bit by me

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

Branch
------
master

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

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out |  2 +-
src/backend/optimizer/util/inherit.c           | 86 +++++++++++++-------------
2 files changed, 45 insertions(+), 43 deletions(-)



Message-ID: <E1h8oY3-0005Nt-F3@gemulon.postgresql.org>
Permalink:  ../E1h8oY3-0005Nt-F3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h8oY3-0005Nt-F3@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: Get rid of duplicate child RTE for a partitioned table.
  In-Reply-To: <E1h8oY3-0005Nt-F3@gemulon.postgresql.org>
  References: <E1h8oY3-0005Nt-F3@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