Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode - Mailing list pgsql-committers

From Amit Kapila
Subject Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode
Date
Msg-id CAA4eK1L7YcGcMdWB3Jh+YU_t+WftWuwr-YVONj_r77O5dZUNTw@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-committers
On Thu, Mar 25, 2021 at 11:45 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Thu, Mar 25, 2021 at 5:08 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> > Wouldn't we need to invalidate the hash entries as soon as something
> > parallel-unsafe is associated with them?
>
> Yes.
>
> > If so, how is this better
> > than setting a flag in relcache?
>
> You can't legally access a flag in the relcache without taking a
> relation lock.
>

But won't some form of lock is required for each rel entry in the hash
table as well for the same duration as is required for rel? Because
otherwise, while we are processing the statement or other relations in
the query, something parallel-unsafe could be attached to that
corresponding rel entry in the hash table. And, I feel probably some
concurrency bottleneck might happen because DDL/DML needs to access
this table at the same time.

-- 
With Regards,
Amit Kapila.



pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Fix interaction of TOAST compression with expression indexes.
Next
From: Amit Kapila
Date:
Subject: Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode