Re: [HACKERS] utility commands benefiting from parallel plan - Mailing list pgsql-hackers

From Haribabu Kommi
Subject Re: [HACKERS] utility commands benefiting from parallel plan
Date
Msg-id CAJrrPGfo58TrYxnqwnFAo4+tYr8wUH-oC0dJ7V9x7gAOZeaz+Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] utility commands benefiting from parallel plan  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers


On Sat, Feb 25, 2017 at 2:45 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote:
On Fri, Feb 24, 2017 at 11:43 AM, Haribabu Kommi
<kommi.haribabu@gmail.com> wrote:
> Here I attached an implementation patch that allows
> utility statements that have queries underneath such as
> CREATE TABLE AS, CREATE MATERIALIZED VIEW
> and REFRESH commands to benefit from parallel plan.
>
> These write operations not performed concurrently by the
> parallel workers, but the underlying query that is used by
> these operations are eligible for parallel plans.
>
> Currently the write operations are implemented for the
> tuple dest types DestIntoRel and DestTransientRel.
>
> Currently I am evaluating other write operations that can
> benefit with parallelism without side effects in enabling them.

The Idea looks good to me.

Since we are already modifying heap_prepare_insert, I am thinking that
we can as well enable queries like "insert into .. select from .."
with minor modification?

Thanks for the review.

I am finding it not so easy in supporting write operations like INSERT,
DELETE and UPDATE commands to use parallelism benefits for the
queries that are underneath.

Currently the parallelism is enabled only for the tables that don't have
any triggers and indexes with expressions. This limitation can be
removed after a though testing.

To support the same, I removed all the errors from heap functions
and functions to get a new transaction and updating the command id
to the current snapshot (Required for the cases where a single command
validates the input).
 
Attached a WIP patch for the support for DML write operations.
There is no functional change in base utility write support patch.
 
Regards,
Hari Babu
Fujitsu Australia
Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] Replication vs. float timestamps is a disaster
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] pg_upgrade loses security lables and COMMENTs on blobs