Master PostgreSQL Views: 5 Essential Types to Optimize Your Database

A PostgreSQL view is essentially a saved (named) query that you can use like a new table

It doesn’t store data on its own but instead just displays the newest, most current result each time it is queried

A materialized view is a special type of view in PostgreSQL that stores the result of the query physically, just like a table

PostgreSQL Views simplify complex queries through the encapsulation of duplicate SQL logic

Materialized views are not updated by default when the base tables are changed. You have to manually refresh them using the REFRESH MATERIALIZED VIEW command