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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: David Rowley <david.rowley@2ndquadrant.com>
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-03T09:15:07Z
Lists: pgsql-hackers
On Tue, Jul 03, 2018 at 09:05:41PM +1200, David Rowley wrote:
>
> [...]
>
> I'd categorise this one the same as I have #1 above, i.e. not
> backpatch material. It seems like something useful to look into for
> v12 though. I assumed this was done for a reason and that I just
> didn't understand what that reason was. I don't recall any comments to
> explain the reason why we build two RangeTblEntrys for each
> partitioned table.

I agree.  Please let's keep v11 stable, and discuss further more on
future optimizations like the previous two items for v12, which has
plenty of time to be broken.

> In light of what Amit has highlighted, I'm still standing by the v3
> patch assuming the typo is fixed.

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.
--
Michael

Commits

  1. Remove dead code for temporary relations in partition planning

  2. Clarify use of temporary tables within partition trees

  3. Expand partitioned table RTEs level by level, without flattening.