This topic describes how to manage materialized views.

View the definition of materialized views

Required permissions
You must have SELECT permissions on materialized views.
Syntax
SHOW CREATE MATERIALIZED VIEW <mv_name>
Feature description
Returns details about a DDL statement used to create a materialized view.

Show materialized views

Required permissions
You must have SELECT permissions on materialized views.
Syntax
SHOW MATERIALIZED VIEWS [LIKE 'pattern']
Feature description
Returns a list of materialized views that have SELECT permissions. If a pattern is specified, all materialized views that match the pattern are returned.

Modify materialized views

Required permissions
You must have ALTER permissions on materialized views.
Syntax
ALTER MATERIALIZED VIEW <mv_name>
[<ENABLE|DISABLE> QUERY REWRITE]
Feature description
<ENABLE|DISABLE> QUERY REWRITE: enables or disables the smart rewrite feature for queries.
Note You cannot modify other properties.

Delete materialized views

Required permissions
You must have DROP permissions on materialized views.
Syntax
DROP MATERIALIZED VIEW <mv_name>
Feature description
Deletes a materialized view. You cannot use DROP TABLE to delete materialized views.