Re: [PERFORM] partitioning materialized views

2017-07-06 Thread Rick Otten
> > > 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;

Re: [PERFORM] partitioning materialized views

2017-07-06 Thread Rick Otten
On Thu, Jul 6, 2017 at 11:25 AM, Shaun Thomas wrote: > > I'm curious if I'm overlooking other possible architectures or tools > that might make this simpler to manage. > > One of the issues with materialized views is that they are based on > views... For a concurrent update, it essentially perfor

Re: [PERFORM] partitioning materialized views

2017-07-06 Thread Shaun Thomas
> I'm curious if I'm overlooking other possible architectures or tools that > might make this simpler to manage. One of the issues with materialized views is that they are based on views... For a concurrent update, it essentially performs a looped merge, which can be pretty ugly. That's the price

[PERFORM] partitioning materialized views

2017-07-06 Thread Rick Otten
I'm pondering approaches to partitioning large materialized views and was hoping for some feedback and thoughts on it from the [perform] minds. PostgreSQL 9.6.3 on Ubuntu 16.04 in the Google Cloud. I have a foreign table with 250M or so rows and 50 or so columns, with a UUID as the primary key.