From the course: Advanced SQL for Query Tuning and Performance Optimization
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Refreshing materialized views - SQL Tutorial
From the course: Advanced SQL for Query Tuning and Performance Optimization
Refreshing materialized views
- [Instructor] It's important to remember that materialized views save data from the source tables into a new data structure. The data that was in the source tables at the time the materialized view are created. That's what's there in the materialized view even if the underlying table is updated. So let's take a look at the data in the MV staff materialized for you. Select star from MV staff. And we'll run this and we'll see. We have the four columns we would expect. Last name, department, job title, and company region. So the values that we see here are the values that were in the tables, in the staff table and in the company region table at the time the materialized view was created. Now let's assume the staff table has been updated. Those update operations or those changes are not necessarily reflected in the materialized view until we actually force those updates to be included in the materialized view. And to do…