Re: pgsql: Clarify use of temporary tables within partition trees
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>,
Robert Haas <robertmhaas@gmail.com>, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, pgsql-committers <pgsql-committers@postgresql.org>
Date: 2018-07-03T11:16:55Z
Lists: pgsql-hackers
Attachments
- remove_dead_code_from_expand_partitioned_rtentry_v4.patch (application/octet-stream) patch v4
On 3 July 2018 at 21:53, Michael Paquier <michael@paquier.xyz> wrote:
> 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.
Oh okay. Yeah, you can hit that with a partitionless sub-partitioned table.
I've added a test in the attached v4.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Remove dead code for temporary relations in partition planning
- 5fca035903a2 11.0 landed
- fc057b2b8fc3 12.0 landed
-
Clarify use of temporary tables within partition trees
- 5862174ec78a 10.5 cited
-
Expand partitioned table RTEs level by level, without flattening.
- 0a480502b092 11.0 cited