Bird
0
0

You created a materialized view but forgot to refresh it after data changes. What will happen when you query it?

medium📝 Debug Q6 of 15
PostgreSQL - Views and Materialized Views
You created a materialized view but forgot to refresh it after data changes. What will happen when you query it?
AYou get stale data from the last refresh or creation time.
BYou get the latest data automatically without any manual action.
CYou get an error indicating the view is outdated.
DThe query will fail because materialized views must be refreshed before use.
Step-by-Step Solution
Solution:
  1. Step 1: Understand refresh behavior of materialized views

    Materialized views do not update automatically; they must be refreshed manually or via a schedule.
  2. Step 2: Querying without refresh returns old data

    If not refreshed, queries return the stored data from the last refresh or creation.
  3. Final Answer:

    You get stale data from the last refresh or creation time. -> Option A
  4. Quick Check:

    Materialized view stale data without refresh = B [OK]
Quick Trick: Materialized views need manual refresh to update data [OK]
Common Mistakes:
  • Assuming automatic refresh on query
  • Expecting errors if not refreshed
  • Confusing materialized views with regular views

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes