Re: partitioning materialized views

From: Rick Otten <rottenwindfish(at)gmail(dot)com>
To: Shaun Thomas <shaun(dot)thomas(at)2ndquadrant(dot)com>
Cc: "pgsql-performa(dot)" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: partitioning materialized views
Date: 2017-07-06 16:27:27
Message-ID: CAMAYy4L9msh+hzPwYPVypVrxDPa4U2A0AV_HmwBzO7rY_ThOhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Shaun Thomas 2017-07-07 13:12:58 Re: partitioning materialized views
Previous Message Rick Otten 2017-07-06 16:05:33 Re: partitioning materialized views