Re: utility commands benefiting from parallel plan

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: utility commands benefiting from parallel plan
Date: 2017-02-28 01:42:34
Message-ID: CAJrrPGfo58TrYxnqwnFAo4+tYr8wUH-oC0dJ7V9x7gAOZeaz+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 25, 2017 at 2:45 AM, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:

> On Fri, Feb 24, 2017 at 11:43 AM, Haribabu Kommi
> <kommi(dot)haribabu(at)gmail(dot)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 Content-Type Size
0002_dml_write_using_parallel_1.patch application/octet-stream 19.9 KB
0001_utility_write_using_parallel_1.patch application/octet-stream 11.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2017-02-28 01:44:40 Re: pg_upgrade loses security lables and COMMENTs on blobs
Previous Message David Steele 2017-02-28 01:33:34 Backend crash on non-exclusive backup cancel