postgresqlmaterialized-views

Materialized views with partitions in PostgreSQL


Can we create materialized views with partitions in PostgreSQL (version 10.7) ?

Thanks


Solution

  • No, you cannot, and it is not easy to think of a use case for that.

    True, some carefully designed queries can be faster on a partitioned table, but most queries become slower.

    You can work around the “deficiency” by creating a table and filling it with INSERT INTO ... SELECT ....