Re: Materialized views WIP patch - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Materialized views WIP patch
Date
Msg-id m27gplyz7e.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: Materialized views WIP patch  ("Kevin Grittner" <kgrittn@mail.com>)
List pgsql-hackers
"Kevin Grittner" <kgrittn@mail.com> writes:
>> UPDATE MATERIALIZED VIEW was problematic?
>
> Not technically, really, but I saw two reasons that I preferred LOAD MV:
>
> 1. It seems to me to better convey that the entire contents of the MV
>    will be built from scratch, rather than incrementally adjusted.
> 2. We haven't hashed out the syntax for more aggressive maintenance of
>    an MV, and it seemed like UPDATE MV might be syntax we would want to
>    use for something which updated selected parts of an MV when we do.

Good point, and while I'm in the mood for some grammar input, here's a
try:
 ALTER MATERIALIZED VIEW foo RESET; ALTER MATERIALIZED VIEW foo UPDATE;

I think such wholesale operations make more sense as ALTER statement
than as UPDATE statements.

> It builds a new heap and moves it into place. When the transaction
> running LMV commits, the old heap is deleted. In implementation it is
> closer to CLUSTER or the new VACUUM FULL than TRUNCATE followed by
> creating a new table. This allows all permissions, etc., to stay in
> place.

When you say closer to CLUSTER, do you include the Access Exclusive Lock
that forbids reading the previous version's data while you prepare the
new one? That would be very bad and I wouldn't understand the need to,
in the scope of MATERIALIZED VIEWs which are by definition lagging
behind…

If as I think you don't have that limitation in your implementation,
it's awesome and just what I was hoping to read :)

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support




pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: another idea for changing global configuration settings from SQL
Next
From: Tom Lane
Date:
Subject: Re: Materialized views WIP patch