From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Amit Kapila <akapila(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode |
Date: | 2021-03-29 19:29:42 |
Message-ID: | CA+TgmoaK4feYaYA+mpw_CWzRKfQDYfZPSn2Gmnijy=AQEB0XRg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On Thu, Mar 25, 2021 at 11:59 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> 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.
Hmm, yeah. I hadn't thought of that, but you're right: it's not good
enough to determine that there's no problem at the time we start the
query, because somebody could create a problem for a partition we
haven't yet locked before we get around to locking it. This is
something that really deserves a separate discussion rather than being
buried on a thread on -committers with a bunch of other topics, but in
my opinion we probably shouldn't choose to handle this by adding more
locking. The need to lock everything all the time any time we do
anything is part of what sucks in this whole area, and we don't want
to just keep propagating that. I don't know whether it would be OK to
just document that if you concurrently add parallel-unsafe stuff to a
table which is a partition while parallel inserts are going on, you
might cause the insert to error out, but I don't think it's a
completely crazy idea.
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2021-03-29 19:50:04 | pgsql: Allow matching the DN of a client certificate for authentication |
Previous Message | Robert Haas | 2021-03-29 19:13:36 | Re: pgsql: Add a new GUC and a reloption to enable inserts in parallel-mode |