From: Michael Paquier <michael@paquier.xyz>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: pgsql-committers <pgsql-committers@postgresql.org>
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
Date: Tue, 3 Jul 2018 18:53:43 +0900
Message-ID: <20180703095343.GE11732@paquier.xyz> (raw)
In-Reply-To: <CAKJS1f-SB+cAgS82KNYcBbiHR=NYFpx8s9J6+B01vdWOeeDrqw@mail.gmail.com>
References: <CAKJS1f8f8+3FOBhSoopo15uzHsY76+L8cMKhMwBi+x+bvBU7tg@mail.gmail.com>
<20180703061119.GA11732@paquier.xyz>
<CAKJS1f8h8283Vb2NcQH+YOMErdDQZWGuqGoe-gX6yT8TKGf0MA@mail.gmail.com>
<5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp>
<b7cc212d-8455-c548-5a71-3cbf6133abd6@lab.ntt.co.jp>
<20180703070551.GC11732@paquier.xyz>
<d5059f0a-9a93-942f-5a8a-ecd13fc26b94@lab.ntt.co.jp>
<CAKJS1f8Wt3CoYY-7AqtbszBLPrQMaH3xLRd2pSCKDARhQRT__A@mail.gmail.com>
<20180703091507.GD11732@paquier.xyz>
<CAKJS1f-SB+cAgS82KNYcBbiHR=NYFpx8s9J6+B01vdWOeeDrqw@mail.gmail.com>
On Tue, Jul 03, 2018 at 09:30:20PM +1200, David Rowley wrote:
> On 3 July 2018 at 21:15, Michael Paquier <michael@paquier.xyz> wrote:
> > Yeah. Actually I'd like to add a test as well to test the recursion
> > call of expand_partitioned_rtentry. If you have an idea, please let me
> > know or I'll figure out one by myself and add it probably in
> > create_table.sql.
>
> What specifically do you want to test? There are plenty of partitioned
> tests with sub-partitioned tables. Going by [1], there's no shortage
> of coverage.
>
> Of course, the dead code I'm proposing we remove is not covered.
> There's no way to cover it... it's dead.
Your patch removes this part:
- /*
- * If the partitioned table has no partitions or all the partitions are
- * temporary tables from other backends, treat this as non-inheritance
- * case.
- */
- if (!has_child)
- parentrte->inh = false;
And adds this equivalent part:
+ /*
+ * If the partitioned table has no partitions, treat this as the
+ * non-inheritance case.
+ */
+ if (partdesc->nparts == 0)
+ {
+ parentrte->inh = false;
+ return;
+ }
As far as I can see from the coverage report, the former is not tested,
and corresponds to the case of a partition leaf which is itself
partitioned but has no partitions, and the new portion is equivalent to
the part removed. That ought to be tested, particularly as Amit
mentions that there could be improvements with moving it around in
future versions.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, david.rowley@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, robertmhaas@gmail.com, ashutosh.bapat@enterprisedb.com
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
In-Reply-To: <20180703095343.GE11732@paquier.xyz>
References: <CAKJS1f8f8+3FOBhSoopo15uzHsY76+L8cMKhMwBi+x+bvBU7tg@mail.gmail.com> <20180703061119.GA11732@paquier.xyz> <CAKJS1f8h8283Vb2NcQH+YOMErdDQZWGuqGoe-gX6yT8TKGf0MA@mail.gmail.com> <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp> <b7cc212d-8455-c548-5a71-3cbf6133abd6@lab.ntt.co.jp> <20180703070551.GC11732@paquier.xyz> <d5059f0a-9a93-942f-5a8a-ecd13fc26b94@lab.ntt.co.jp> <CAKJS1f8Wt3CoYY-7AqtbszBLPrQMaH3xLRd2pSCKDARhQRT__A@mail.gmail.com> <20180703091507.GD11732@paquier.xyz> <CAKJS1f-SB+cAgS82KNYcBbiHR=NYFpx8s9J6+B01vdWOeeDrqw@mail.gmail.com> <20180703095343.GE11732@paquier.xyz>
* 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