HomeMogDBMogDB StackUqbar
v3.0

Documentation:v3.0

Supported Versions:

REFRESH MATERIALIZED VIEW

Function

REFRESH MATERIALIZED VIEW refreshes materialized views in full refresh mode.

Precautions

  • Full refreshing can be performed on both full and fast-refresh 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.
MogDB=# CREATE TABLE my_table (c1 int, c2 int);
-- Create a complete-refresh materialized view.
MogDB=# CREATE MATERIALIZED VIEW my_mv AS SELECT * FROM my_table;
-- Create an fast-refresh materialized view.
MogDB=# CREATE INCREMENTAL MATERIALIZED VIEW my_imv AS SELECT * FROM my_table;
-- Write data to the base table.
MogDB=# INSERT INTO my_table VALUES(1,1),(2,2);
-- Refresh the complete-refresh materialized view my_mv.
MogDB=# REFRESH MATERIALIZED VIEW my_mv;
-- Fully refresh the fast-refresh materialized view my_imv.
MogDB=# REFRESH MATERIALIZED VIEW my_imv;

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

Copyright © 2011-2024 www.enmotech.com All rights reserved.