Re: refresh materialized view concurrently - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: refresh materialized view concurrently
Date
Msg-id 1372343112.77919.YahooMailNeo@web162905.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: refresh materialized view concurrently  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> wrote:

> We can play cute tricks akin to what CREATE INDEX CONCURRENTLY currently
> does, i.e. wait for all other relations that could have possibly seen
> the old relfilenode (they must have at least a share lock on the
> relation) before dropping the actual storage.
>
> The reason we cannot currently do that in most scenarios is that we
> cannot perform transactional/mvcc updates of non-exclusively locked
> objects due to the SnapshotNow problems of seeing multiple or no
> versions of a row during a single scan.

Not only would that be slower than the submitted patch in cases
where only a few rows differ, but it could be waiting to swap in
that new heap for an unbounded amount of time.  I think the current
patch will "play nicer" with incremental maintenance than what you
suggest here.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Move unused buffers to freelist
Next
From: Robert Haas
Date:
Subject: Re: Spin Lock sleep resolution