Re: Materialized views WIP patch

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Materialized views WIP patch
Дата
Msg-id CAEZATCXqytH9iLzq8JL8xoCDocFQHCrA577J8aWxdEqNm+YzCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Materialized views WIP patch  (Kevin Grittner <kgrittn@ymail.com>)
Ответы Re: Materialized views WIP patch  (Kevin Grittner <kgrittn@ymail.com>)
Список pgsql-hackers
On 2 March 2013 15:06, Kevin Grittner <kgrittn@ymail.com> wrote:
> [ ... ] led to
> this thought:
>
> REFRESH MATERIALIZED VIEW name [, ...] WITH [ NO ] DATA
>

[Sorry to join this discussion so late]

FWIW I had a quick look at other DBs to see if there were any other
precedents out there. Oracle was the only one I could find with
anything similar. They use the same creation syntax:
 CREATE MATERIALIZED VIEW name [options] AS SELECT ...

and they use ALTER for everything else, such as refreshing the MV:
 ALTER MATERIALIZED VIEW name REFRESH [options];

AFAICT the nearest thing they have to TRUNCATE/DISCARD is:
 ALTER MATERIALIZED VIEW name CONSIDER FRESH;

They do also support updateable materialized views with standard DML,
but it doesn't look as though they allow TRUNCATE to operate directly
on a MV (although it can be made to propagate from a base table to a
MV, in which case allowing TRUNCATE on the MV itself with a different
meaning would likely be confusing).

Oracle's MVs have lots of options, all of which hang off the 2 basic
CREATE and ALTER commands. There's a certain appeal to that, rather
than inventing or overloading a bunch of other commands as more
options get added. The proposed REFRESH command is OK for today's
options, but I think it might be overly limiting in the future.

Of course, since this isn't in the SQL standard, we are free to use
any syntax we like. We don't have to follow Oracle, but having a
common syntax might make some people's lives easier, and I haven't
seen a convincing argument as to why any alternative syntax is better.

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Satoshi Nagayasu
Дата:
Сообщение: Fix pgstattuple/pgstatindex to use regclass-type as the argument
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Support for REINDEX CONCURRENTLY