What is the difference between Views and Materialized Views in Oracle?

前端 未结 8 2068
一向
一向 2020-12-02 03:35

What is the difference between Views and Materialized Views in Oracle?

相关标签:
8条回答
  • 2020-12-02 04:13

    Materialized views are the logical view of data-driven by the select query but the result of the query will get stored in the table or disk, also the definition of the query will also store in the database.

    The performance of Materialized view it is better than normal View because the data of materialized view will be stored in table and table may be indexed so faster for joining also joining is done at the time of materialized views refresh time so no need to every time fire join statement as in case of view.

    Other difference includes in case of View we always get latest data but in case of Materialized view we need to refresh the view for getting latest data. In case of Materialized view we need an extra trigger or some automatic method so that we can keep MV refreshed, this is not required for views in the database.

    0 讨论(0)
  • 2020-12-02 04:14

    Views are essentially logical table-like structures populated on the fly by a given query. The results of a view query are not stored anywhere on disk and the view is recreated every time the query is executed. Materialized views are actual structures stored within the database and written to disk. They are updated based on the parameters defined when they are created.

    0 讨论(0)
提交回复
热议问题