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

From Pavel Stehule
Subject Re: Materialized views WIP patch
Date
Msg-id CAFj8pRCd+3cqW-ApMpc8jUK3OuO6Qv1ke_CsSciEUYTJnqQreA@mail.gmail.com
Whole thread Raw
In response to Re: Materialized views WIP patch  ("David Johnston" <polobo@yahoo.com>)
Responses Re: Materialized views WIP patch
List pgsql-hackers
2012/11/27 David Johnston <polobo@yahoo.com>:
>> -----Original Message-----
>> From: pgsql-hackers-owner@postgresql.org [mailto:pgsql-hackers-
>> owner@postgresql.org] On Behalf Of Dimitri Fontaine
>> Sent: Tuesday, November 27, 2012 10:03 AM
>> To: Kevin Grittner
>> Cc: Pavel Stehule; Peter Eisentraut; Pgsql Hackers
>> Subject: Re: [HACKERS] Materialized views WIP patch
>>
>> "Kevin Grittner" <kgrittn@mail.com> writes:
>> > changing the structure of the table. Somehow I don't find that
>> > pursuasive as an argument for what ALTER MATERIALIZED VIEW should
>> > rescan the source relations and build a whole new set of data for
>> > exactly the same MV definition.
>>
>> Fair enough.
>>
>> > Consider that in relational theory a table is considered a relation
>> > variable. ALTER is supposed to change the definition of the variable
>> > in some way. Other statements are used to change the value contained
>> > in the variable. Sure there are some grey areas already, but I don't
>> > see where we need to muddy the waters in this case.
>>
>> Under that light, using ALTER is strange indeed. I still don't like using
> LOAD
>> that much, allow me to try a last syntax proposal. Well all I can find
> just now
>> would be:
>>
>>   UPDATE MATERIALIZED VIEW mv FOR EACH ROW;
>>   UPDATE MATERIALIZED VIEW mv FOR EACH STATEMENT [ CONCURRENTLY ];
>>
>> The only value of such a proposal is that it's not LOAD and it's still not
>> introducing any new keyword. Oh it's also avoiding to overload the
>> SNAPSHOT keyword. Well, it still does not look like the best candidate.
>>
>> Regards,
>
> Just a thought but how about something like:
>
> DO REFRESH OF MATERIALIZED VIEW mat_view;
>
> In effect we begin overloading the meaning of "DO" to not only mean
> anonymous code blocks but to also call pre-defined internal routines that
> can be executed without having to use function-call syntax.  "MATERIALIZED
> VIEW" can be more generic "e.g., TABLE" if the need arises, the REFRESH
> "Action" is generic, and additional clauses can be added after the object
> name (FOR, CONCURRENTLY, WHERE, etc...)

-1

I  unlike using keywords DO for this purpose - when we use it for
anonymous blocks

Regards

Pavel

>
> David J.
>
>
>
>
>
>
>
>



pgsql-hackers by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Materialized views WIP patch
Next
From: Tom Lane
Date:
Subject: Re: ilist.h fails cpluspluscheck