This topic describes how to manage materialized views.
View the definition of a materialized view
- Required permissions
- You must have SELECT permissions on a materialized view.
- Syntax
SHOW CREATE MATERIALIZED VIEW <mv_name>
- Feature description
- Returns details about a DDL statement used to create a materialized view.
Query 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 on which you have SELECT permissions. If a pattern is specified, all materialized views that match the pattern are returned.
Delete a materialized view
- Required permissions
- You must have DROP permissions on a materialized view.
- Syntax
DROP MATERIALIZED VIEW <mv_name>
- Feature description
- Deletes a materialized view. You cannot execute the DROP TABLE statement to delete materialized views.
Materialized view information tables
- information_schema.mv_info
- This table contains the metadata of all materialized views.
- information_schema.mv_auto_refresh_jobs
- The table contains the auto-refresh records of materialized views. Only the materialized views that are configured with auto-refresh are displayed in this table. Up to 1,024 materialized views can be displayed.