Bird
0
0

Why might a materialized view become out of date, and how does PostgreSQL handle this internally?

hard📝 Conceptual Q10 of 15
PostgreSQL - Views and Materialized Views
Why might a materialized view become out of date, and how does PostgreSQL handle this internally?
ABecause materialized views are read-only; PostgreSQL locks them permanently.
BBecause materialized views are temporary; PostgreSQL deletes them on restart.
CBecause materialized views cache queries; PostgreSQL auto-refreshes them on select.
DBecause base tables change; PostgreSQL does not auto-update materialized views internally.
Step-by-Step Solution
Solution:
  1. Step 1: Understand data staleness in materialized views

    Materialized views store snapshots; changes in base tables do not reflect automatically.
  2. Step 2: Know PostgreSQL behavior

    PostgreSQL requires manual refresh; it does not auto-update materialized views internally.
  3. Final Answer:

    Because base tables change; PostgreSQL does not auto-update materialized views internally. -> Option D
  4. Quick Check:

    Materialized views = static until manual refresh [OK]
Quick Trick: Materialized views need manual refresh; no automatic internal update [OK]
Common Mistakes:
  • Assuming automatic refresh on select
  • Confusing materialized views with temporary tables
  • Thinking materialized views are locked permanently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes