🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Databases Intermediate

What is Materialized View?

A database object that stores the precomputed result of a query, offering faster reads at the cost of periodic refresh.

Unlike regular views that execute their query each time they are accessed, materialized views store query results physically on disk. This dramatically speeds up complex aggregations, joins, and analytical queries. The trade-off is data freshness — materialized views must be refreshed (manually or on schedule) to reflect underlying table changes. PostgreSQL supports REFRESH MATERIALIZED VIEW with a CONCURRENTLY option for zero-downtime refreshes. They are invaluable for dashboards, reports, and read-heavy workloads where slight data staleness is acceptable.

Related Terms

CTE (Common Table Expression)
A temporary named result set defined within a SQL statement using the WITH clause, improving query readability and enabling recursion.
Index
A data structure that improves the speed of data retrieval operations on database tables at the cost of additional storage.
Cursor
A database object that enables row-by-row processing of query results, useful for operations that cannot be done in bulk.
NoSQL
A category of databases that store data in non-tabular formats, optimized for specific data models and access patterns.
Upsert
A database operation that inserts a new row if it does not exist, or updates the existing row if it does.
Graph Database
A database that uses graph structures with nodes, edges, and properties to store and query highly connected data.
View All Databases Terms →