Scenario:
What is
the difference between view and materialized view?
Solution:
View
|
Materialized view
|
A view has a logical existence. It does not contain
data.
|
A materialized view has a physical existence.
|
Its not a database object.
|
It is a database object.
|
We cannot perform DML operation on view.
|
We can perform DML operation on materialized view.
|
When we do select * from view it will fetch the data
from base table.
|
When we do select * from materialized view it will fetch
the data from materialized view.
|
In view we cannot schedule to refresh.
|
In materialized view we can schedule to refresh.
|
|
We can keep aggregated data into materialized view.
Materialized view can be created based on multiple tables.
|
Materialized View
Materialized view is very essential for reporting. If we
don’t have the materialized view it will directly fetch the data from dimension
and facts. This process is very slow since it involves multiple joins. So the
same report logic if we put in the materialized view. We can fetch the data
directly from materialized view for reporting purpose. So that we can avoid
multiple joins at report run time.
It is always necessary to refresh the materialized view.
Then it can simply perform select statement on materialized view.
Comments
Post a Comment