Re: Multi-level hierarchy with parallel append can lead to an extra subplan. - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Multi-level hierarchy with parallel append can lead to an extra subplan.
Date
Msg-id CA+TgmoYsH4-+5reuDu7jfpUe2bZbk9oM3btK0a_+En6Rd9DFcA@mail.gmail.com
Whole thread Raw
In response to Re: Multi-level hierarchy with parallel append can lead to an extra subplan.  (Amit Khandekar <amitdkhan.pg@gmail.com>)
List pgsql-hackers
On Tue, Jan 9, 2018 at 5:41 AM, Amit Khandekar <amitdkhan.pg@gmail.com> wrote:
> This subplan should not be there. It looks like that's because when
> we add up subpaths while preparing Parallel Append path containing mix of
> partial and non-partial child paths, in accumulate_append_subpath(),
> the subpath being added is an Append path because it's a multi-level
> partition. So in the condition "else if (special_subpaths != NULL)",
> both *subpaths and *special_paths get updated. But then it is not
> returning from there when it should. Instead, the control passes to
> the end of function where *subpaths is again populated :
> *subpaths = lappend(*subpaths, path);
> which leads to an extra child with partial subpath getting added.

Boy, what a dumb mistake on my part.  Thanks for finding the bug,
Rajkumar.  Thanks for analyzing it, Amit.  I have committed the fix.

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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Rangejoin rebased
Next
From: Simon Riggs
Date:
Subject: Re: let's make the list of reportable GUCs configurable (was Re: Add%r substitution for psql prompts to show recovery status)