Re: refresh materialized view concurrently

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refresh materialized view concurrently
Date: 2013-07-03 14:32:45
Message-ID: CA+TgmoY9c758oNEeJ5HMXpsVOf3jfa40qoV-_VhD3JKx+OaLQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 3, 2013 at 10:25 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Kevin Grittner <kgrittn(at)ymail(dot)com> writes:
>> Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> I doubt very much that this is safe. And even if it is safe
>>> today, I think it's a bad idea, because we're likely to try to
>>> reduce lock levels in the future. Taking no lock on a relation
>>> we're opening, even an index, seems certain to be a bad idea.
>
> I'm with Robert on this.
>
>> What we're talking about is taking a look at the index definition
>> while the indexed table involved is covered by an ExclusiveLock.
>> Why is that more dangerous than inserting entries into an index
>> without taking a lock on that index while the indexed table is
>> covered by a RowExclusiveLock, as happens on INSERT?
>
> I don't believe that that happens. If it does, it's a bug. Either the
> planner or the executor should be taking a lock on each index touched
> by a query.

It seems Kevin's right. Not sure why that doesn't break.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-07-03 14:43:07 Re: New regression test time
Previous Message Tom Lane 2013-07-03 14:25:43 Re: refresh materialized view concurrently