Re: FailedAssertion on partprune - Mailing list pgsql-hackers

From Robert Haas
Subject Re: FailedAssertion on partprune
Date
Msg-id CA+TgmoYfP7-hgA1JH7aix2uAZWk2aDA3Pm-0Xzyi5JnP4c84mw@mail.gmail.com
Whole thread Raw
In response to Re: FailedAssertion on partprune  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: FailedAssertion on partprune
List pgsql-hackers
On Thu, Aug 2, 2018 at 8:42 PM, David Rowley
<david.rowley@2ndquadrant.com> wrote:
> Wouldn't that code have more flexibility to flatten the Append if it
> were to, instead of looking at the Append's subpaths, look at the
> subpath's Parent RelOptInfo paths and just use the Append and
> MergeAppend as a container to identify the relations that must be
> included, rather than the paths that should be?

Well, we actually start with a list of RelOptInfos, take the cheapest
path from each whether partial or non-partial, and then build a
Parallel Append out of the result, so there's no need to work backward
from the chosen path to the Parallel Append.  As to whether it's ever
better to take a path other than the cheapest to facilitate
flattening, I'm not sure.  At the moment, I can't think of a scenario
in which that would pay off, but there may be one.  I think that if
we're using Parallel Append at all, we're likely going to use it
throughout the plan tree, in which case everything will get flattened
just fine.  There might well be corner cases where that isn't so,
though, and in some of those flattening may be advantageous, but I
can't think of anything really clear and obvious.  You might have
better ideas than I do.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw with partitionwise join enabled.
Next
From: Robert Haas
Date:
Subject: Re: Explain buffers wrong counter with parallel plans