Consider a materialized view sales_summary that aggregates sales data. After new sales are inserted into the base table, what will be the result of running REFRESH MATERIALIZED VIEW sales_summary;?
REFRESH MATERIALIZED VIEW sales_summary;Think about what a materialized view stores and what refreshing it means.
Refreshing a materialized view updates its stored data to match the current state of the underlying tables. It does not delete or lock the view permanently.
Choose the correct syntax to refresh a materialized view named inventory_status in PostgreSQL.
Remember the exact order of keywords in the command.
The correct syntax is REFRESH MATERIALIZED VIEW view_name;. Other options are invalid SQL.
You want to refresh a materialized view daily_report but allow users to continue reading the old data during the refresh. Which option achieves this?
REFRESH MATERIALIZED VIEW CONCURRENTLY daily_report;Look for the keyword that allows concurrent reads during refresh.
The CONCURRENTLY option refreshes the materialized view without locking out reads, allowing users to query the old data until the refresh completes.
You run REFRESH MATERIALIZED VIEW CONCURRENTLY sales_data; but get the error: ERROR: materialized view must have a unique index to use CONCURRENTLY. What is the cause?
REFRESH MATERIALIZED VIEW CONCURRENTLY sales_data;Check the requirements for using CONCURRENTLY with materialized views.
To refresh a materialized view concurrently, it must have at least one unique index to identify rows during the refresh process.
When you execute REFRESH MATERIALIZED VIEW, which of the following best describes what happens inside the database?
Think about how materialized views store data and how refresh works.
REFRESH MATERIALIZED VIEW reruns the original query and replaces the stored data entirely. PostgreSQL does not support incremental refresh by default.