云数据库 GAUSSDB-REFRESH INCREMENTAL MATERIALIZED VIEW:示例

时间:2024-11-02 18:48:30

示例

--创建一个普通表
openGauss=# CREATE TABLE my_table (c1 int, c2 int);
--创建增量物化视图
openGauss=# CREATE INCREMENTAL MATERIALIZED VIEW my_imv AS SELECT * FROM my_table;
--基表写入数据
openGauss=# INSERT INTO my_table VALUES(1,1),(2,2);
--对增量物化视图my_imv进行增量刷新
openGauss=# REFRESH INCREMENTAL MATERIALIZED VIEW my_imv;
support.huaweicloud.com/distributed-devg-v2-gaussdb/gaussdb_v5r2c10_0593.html