Views vs Materialized Views
1.First difference between View & Materlized View is that , In Views query result is not stored in the disk or database But MV allow to store query result in disk or table.
2. In case of view we always get latest data but in case of MV we need to refresh the view for getting latest data.
3.Performance of view is less than MV.
4.One more difference , In case of view its only the logical view of table no separate copy of table but in case of MV we get separate copy of table.
5.In case of MV we need extra trigger or some automatic method so that we can keep MV refreshed ,This is not required for view in database.
6.A materialized view may be used by the optimizer as a way of pre-aggregating certain interesting data sets in order to more efficiently answer business questions. A view is just a stored query that is executed at runtime.
7.A view occupies no space. but materialized view occupies space. It exists in the same way as a table:
it sits on a disk and could be indexed or partitioned.
No comments:
Post a Comment