Bird
0
0

If you run REFRESH MATERIALIZED VIEW CONCURRENTLY mv_sales; on a materialized view, what is the main benefit?

medium📝 query result Q5 of 15
PostgreSQL - Views and Materialized Views
If you run REFRESH MATERIALIZED VIEW CONCURRENTLY mv_sales; on a materialized view, what is the main benefit?
AAllows querying the view while it refreshes
BDeletes the materialized view after refresh
CLocks the base tables during refresh
DRefreshes only changed rows
Step-by-Step Solution
Solution:
  1. Step 1: Understand CONCURRENTLY option in refresh

    REFRESH MATERIALIZED VIEW CONCURRENTLY allows the view to be queried during refresh without locking.
  2. Step 2: Analyze other options

    It does not delete the view, lock base tables, or refresh only changed rows.
  3. Final Answer:

    Allows querying the view while it refreshes -> Option A
  4. Quick Check:

    Concurrent refresh = no query blocking [OK]
Quick Trick: Use CONCURRENTLY to avoid blocking queries during refresh [OK]
Common Mistakes:
  • Thinking it deletes the view
  • Assuming base tables get locked
  • Believing it refreshes only changed rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes