Re: Parallel Append implementation

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>, Rafia Sabih <rafia(dot)sabih(at)enterprisedb(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Append implementation
Date: 2017-09-29 21:40:12
Message-ID: CA+TgmoY+imts-ZRFhX_DJiQ=bKjnAspThbEzUeGOWfuK=v37dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 16, 2017 at 2:15 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> Yes, we can do that and that is what I think is probably better. So,
> the question remains that in which case non-parallel-aware partial
> append will be required? Basically, it is not clear to me why after
> having parallel-aware partial append we need non-parallel-aware
> version? Are you keeping it for the sake of backward-compatibility or
> something like for cases if someone has disabled parallel append with
> the help of new guc in this patch?

We can't use parallel append if there are pathkeys, because parallel
append will disturb the output ordering. Right now, that never
happens anyway, but that will change when
https://commitfest.postgresql.org/14/1093/ is committed.

Parallel append is also not safe for a parameterized path, and
set_append_rel_pathlist() already creates those. I guess it could be
safe if the parameter is passed down from above the Gather, if we
allowed that, but it's sure not safe in a case like this:

Gather
-> Nested Loop
-> Parallel Seq Scan
-> Append
-> whatever

If it's not clear why that's a disaster, please ask for a more
detailed explaination...

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-09-29 21:56:10 Re: SendRowDescriptionMessage() is slow for queries with a lot of columns
Previous Message Robert Haas 2017-09-29 21:31:17 Re: pgbench - minor fix for meta command only scripts