Re: Consider Parallelism While Planning For REFRESH MATERIALIZED VIEW

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Luc Vlaming <luc(at)swarm64(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Subject: Re: Consider Parallelism While Planning For REFRESH MATERIALIZED VIEW
Date: 2021-03-15 06:28:37
Message-ID: CAA4eK1LZ+-tgTZdBvncuAeLuC-Jpz4QfG9iJnRbGEvpFimfZVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 15, 2021 at 10:39 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
>
> On Mon, Jan 4, 2021 at 9:05 PM Luc Vlaming <luc(at)swarm64(dot)com> wrote:
>
> While reading some back history, I saw that commit e9baa5e9 introduced
> parallelism for CREATE M V, but REFRESH was ripped out of the original
> patch by Robert, who said:
>
> > The problem with a case like REFRESH MATERIALIZED VIEW is that there's
> > nothing to prevent something that gets run in the course of the query
> > from trying to access the view (and the heavyweight lock won't prevent
> > that, due to group locking). That's probably a stupid thing to do,
> > but it can't be allowed to break the world. The other cases are safe
> > from that particular problem because the table doesn't exist yet.
>
> Hmmm.
>

I am not sure but we might want to add this in comments of the refresh
materialize view function so that it would be easier for future
readers to understand why we have not enabled parallelism for this
case.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-03-15 06:32:46 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message Michael Paquier 2021-03-15 06:10:59 Re: PATCH: Attempt to make dbsize a bit more consistent