REFRESH INCREMENTAL MATERIALIZED VIEW

Function

REFRESH INCREMENTAL MATERIALIZED VIEW refreshes a materialized view in incremental mode.

Precautions

  • Incremental refresh supports only fast-refresh materialized views.
  • To refresh a materialized view, you must have the SELECT permission on the base table.

Syntax

REFRESH INCREMENTAL 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 an fast-refresh 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);
-- Incrementally refresh thefast-refresh materializedd view my_imv.
openGauss=# REFRESH INCREMENTAL MATERIALIZED VIEW my_imv;

Helpful Links

ALTER MATERIALIZED VIEW, CREATE INCREMENTAL MATERIALIZED VIEW, CREATE MATERIALIZED VIEW, CREATE TABLE, DROP MATERIALIZED VIEW, and REFRESH MATERIALIZED VIEW

Feedback
编组 3备份
    openGauss 2024-05-07 00:46:52
    cancel