Hi guys,i am making some tests with a massive number of "select" queries (only for reading datas) on a view and a materialized view.We use Postgresql 9.6.1 on a 64bit server.Only for "select" queries, which one is faster and less expensive as resources cost?
The view or the materialized view?
The view has about 500K lines.
There is no simple answer to this - it all depends upon your actual usage. With proper indexes and a disregard for the "REFRESH MATERIALIZED VIEW ..." command cost the materialized view should always perform better. But most people don't get to disregard the refresh dynamic imposed by materialized views.
David J.