⟩ Tell me what is difference between View and Materialized view?
View result set doesn’t save anywhere on disk and executes the query definition whenever they are called, while materialized view are disk based and its result set table is updated periodically.
Materialized view is similar to regular views but the output of select query has been saved to a table.
View shows the latest data all the time while the materialized view only shows the fresh data after its result table is updated either by setting a schedule or based on the change in the underlying tables.
The performance of the view depends on how good the selected statement the view has. If the select statement has too many joins then it the view will perform poorly.
While in the case of materialized view, we are querying a table, which may also be indexed, that increase its performance.