forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
3.9 KiB
3.9 KiB
Configuring the Validity Period and Data Update of Materialized Views
Validity Period of Materialized Views
The mv_validity field for creating a materialized view indicates the validity period of the materialized view. HetuEngine allows you to rewrite the SQL statements using only the materialized views within the validity period.
Refreshing Materialized View Data
If data needs to be updated periodically, you can use either of the following methods to periodically refresh the materialized views:
- Manually refreshing a materialized view
Run the refresh materialized view <mv name> command on the HetuEngine client by referring to HetuEngine, or run the refresh materialized view <mv name> command using JDBC in the service program to manually update the database.
- Automatically refreshing a materialized viewUse create materialized view to create a materialized view that can be automatically refreshed.
- To enable the automatic refresh capability of the materialized views, you must set a computing instance as the maintenance instance must exist. For details, see Configuring a HetuEngine Maintenance Instance.
- If there are too many materialized views, some materialized views may expire due to too long waiting time.
- The automatic refresh function does not automatically refresh materialized views in the disable status.
Parent topic: Using HetuEngine Materialized Views