Re: [PERFORM] partitioning materialized views

Поиск
Список
Период
Сортировка
От Rick Otten
Тема Re: [PERFORM] partitioning materialized views
Дата
Msg-id CAMAYy4L9msh+hzPwYPVypVrxDPa4U2A0AV_HmwBzO7rY_ThOhA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PERFORM] partitioning materialized views  (Rick Otten <rottenwindfish@gmail.com>)
Ответы Re: [PERFORM] partitioning materialized views  (Shaun Thomas <shaun.thomas@2ndquadrant.com>)
Список pgsql-performance

If you _can't_ do
that due to cloud restrictions, you'd actually be better off doing an
atomic swap.

CREATE MATERIALIZED VIEW y AS ...;

BEGIN;
ALTER MATERIALIZED VIEW x RENAME TO x_old;
ALTER MATERIALIZED VIEW y RENAME TO x;
DROP MATERIALIZED VIEW x_old;
COMMIT;

This is an interesting idea.  Thanks!  I'll ponder that one.


I don't think the downstream dependencies will let that work without rebuilding them as well.   The drop fails (without a cascade), and the other views and matviews that are built off of this all simply point to x_old.

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

Предыдущее
От: Rick Otten
Дата:
Сообщение: Re: [PERFORM] partitioning materialized views
Следующее
От: Shaun Thomas
Дата:
Сообщение: Re: [PERFORM] partitioning materialized views