Home  >  Q&A  >  body text

mysql - oracle物化视图和临时表的区别是什么?

黄舟黄舟2743 days ago769

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 16:42:03

    The data of the materialized view is permanently maintained and will be updated regularly or in real time according to the definition as the data in the view-related tables changes. In most cases, materialized views are used for performance optimization, which can greatly improve the operating efficiency of complex SQL.

    The data in the temporary table will be automatically cleared when the transaction is committed or the session is disconnected by definition, so it is more suitable for storing intermediate data in the calculation process.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 16:42:03

    Temporary table data is temporary and cannot be stored permanently. It will not be backed up, and there will be no log information for modifications, but DML operations are faster;
    Materialized view is a display of data within a certain period of time, which can be pre-calculated and saved The results of time-consuming operations such as table joins or aggregations are required to improve query speed, require manual or automatic updates, occupy physical space, and have materialized view logs.

    reply
    0
  • Cancelreply