intermediateViews — Simple View & Materialized View

Can a materialized view speed up a slow query on its own, just by creating it?

Only after it's populated and refreshed — creating it runs the query once to materialize the result, and subsequent reads hit the stored rows directly instead of recomputing. But it does nothing to speed up the underlying query itself; it only avoids re-running that query on every read, at the cost of the data being as stale as the last refresh.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

Can a materialized view speed up a slow query on its own, just by creating it?

Next Step

Continue to What's the difference between UNION and UNION ALL, and which should you default to?← Back to all SQL questions