Re: pgsql: Clarify use of temporary tables within partition trees

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
Date: 2018-07-03 12:15:46
Message-ID: CAFjFpRe=pt_JDF0m_avqj+kcaCLXi11Hs==of88DaFJzQiuu+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Jul 3, 2018 at 3:20 PM, Amit Langote
<Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>
> Maybe because that's what's done for the root parent in a plain
> inheritance hierarchy, which is always a plain table. In that case, one
> RTE is for its role as the parent (with rte->inh = true) and another is
> for its role as a child (with rte->inh = false). The former is processed
> as an append rel and the latter as a plain rel that will get assigned scan
> paths such as SeqScan, etc.

Yes that's true. I remember we had some discussion about these two
RTEs and that the one marked as child was extraneous, but I can not
spot that in the mail thread. It's one of the things we did as part of
partition-wise join and that thread is pretty long. It was probably
kept without changing it because a. we wanted to get the bigger patch
committed without breaking anything and this was a small thing which
we couldn't decide whether was safe or not b. if it was safe not to
create that entry, it should have been done in a commit which avoided
creating scans for partitioned tables, but didn't

>
> For partitioned table parent(s), we need only the former because they can
> only be processed as append rels. That's why I'm proposing we could
> adjust the commit in PG 11 that introduced expand_partitioned_rtentry such
> that the duplicate child RTE and other objects are not created.

FWIW, I think this would be ok before beta, but not now. I see it as a
PG12 item.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-07-03 16:21:34 Re: pgsql: Clarify use of temporary tables within partition trees
Previous Message Peter Eisentraut 2018-07-03 11:34:01 Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey V. Lepikhov 2018-07-03 12:17:57 Re: [WIP] [B-Tree] Retail IndexTuple deletion
Previous Message Robert Haas 2018-07-03 12:02:02 Re: Add --include-table-data-where option to pg_dump, to export only a subset of table data