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.