Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Phil Florent <philflorent(at)hotmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian
Date: 2018-08-02 01:10:57
Message-ID: CAKJS1f8N2j-A5XD5eKETk0E-8UVeDHivAqdaOEeffRHMqvTtzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2 August 2018 at 11:48, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I've pushed the v3 patch with a lot of editorial work (e.g. cleaning
> up comments you hadn't).

Thanks for doing that.

>
>> In [1] I mentioned that I think that bug should be fixed as part of
>> this bug fix too.
>
> I didn't include this change because (a) it's late, (b) no test
> case was included, and (c) I don't entirely believe it anyway.
> How would a rel be both leaf and nonleaf? Isn't this indicative
> of a problem somewhere upstream in the planner?

It's probably best discussed on the other thread, but it seems to be
by design in accumulate_append_subpath(). Parallel Append nodes don't
get flattened if they contain a mix of parallel aware and non-parallel
aware subplans.

So you might be right, maybe a better option is to have that code
reorder the subplans so that the parallel aware ones stay at the end.
I'm just not convinced that fixing that code means it would mean it
would never happen again. It does not seem too outrageous to me to
support nested Appends, and with those, what else would the Path's
parent RelOptInfo be if it's not the partitioned table that the node's
subpaths belong to? Or maybe, in that case, the partitioned_rels
belonging to the sub-Append should not have been included in the List
for the top-level Append.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-08-02 01:20:22 Re: [Patch] Checksums for SLRU files
Previous Message Andrew Gierth 2018-08-02 00:06:41 Problems with plan estimates in postgres_fdw