Обсуждение: Reading on how materialized views are materialized?

Поиск
Список
Период
Сортировка

Reading on how materialized views are materialized?

От
Wells Oliver
Дата:
Where can I find some more detail? I am deciding between a flat table populated for the current month only with a script versus a materialized view, and I'd like to understand better if the latter is intelligently being refreshed (meaning years of data won't be re-populated, only what's changed).

Thanks.

--

Re: Reading on how materialized views are materialized?

От
Thomas Kellerer
Дата:
Wells Oliver schrieb am 22.06.2018 um 20:51:
> Where can I find some more detail? I am deciding between a flat table
> populated for the current month only with a script versus a
> materialized view, and I'd like to understand better if the latter is
> intelligently being refreshed (meaning years of data won't be
> re-populated, only what's changed).


MViews currently don't support "incremental" refresh in Postgres. 

A refresh of a mview is essentially the same as:

  truncate table foo;
  insert into foo 
  select ...
  from ....;

Where the SELECT part is the query used to define the mview.