Help Center/
GaussDB/
Developer Guide(Distributed_2.x)/
SQL Reference/
SQL Syntax/
REFRESH MATERIALIZED VIEW
Updated on 2023-10-23 GMT+08:00
REFRESH MATERIALIZED VIEW
Function
REFRESH MATERIALIZED VIEW refreshes materialized views in full refresh mode.
Precautions
- Full refreshing can be performed on both full and incremental materialized views.
- To refresh a materialized view, you must have the SELECT permission on the base table.
Syntax
REFRESH MATERIALIZED VIEW mv_name;
Parameter Description
- mv_name
Name of the materialized view to be refreshed.
Examples
-- Create an ordinary table. openGauss=# CREATE TABLE my_table (c1 int, c2 int); -- Create a full materialized view. openGauss=# CREATE MATERIALIZED VIEW my_mv AS SELECT * FROM my_table; -- Create an incremental materialized view. openGauss=# CREATE INCREMENTAL MATERIALIZED VIEW my_imv AS SELECT * FROM my_table; -- Write data to the base table. openGauss=# INSERT INTO my_table VALUES(1,1),(2,2); -- Fully refresh the full materialized view my_mv. openGauss=# REFRESH MATERIALIZED VIEW my_mv; -- Fully refresh the incremental materialized view my_imv. openGauss=# REFRESH MATERIALIZED VIEW my_imv;
Parent topic: SQL Syntax
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot