Description
This command is used to view all materialized views under the specified database schema. A materialized view is a special database object that can pre-calculate and store query results to improve query performance. The function of this command is similar to the SQL statement SHOW TABLES, but it is more flexible, allowing users to filter based on conditions.
For more detailed information, please refer to Materialized View.
Syntax
Parameter Description
-
LIKE pattern: Optional parameter used to filter by object name. This filter uses case-insensitive pattern matching and supports SQL wildcards%(representing any number of characters) and_(representing a single character). For example:LIKE '%testing%'. Note that this parameter cannot be used simultaneously with theWHEREcondition. -
IN schema_name: Optional parameter used to specify the schema name. With this parameter, users can view all materialized views under the specified schema. -
WHERE expr: Optional parameter that allows users to filter based on the fields displayed by theSHOW TABLEScommand. This parameter provides a more flexible query method, allowing filtering based on actual needs.
Usage Example
Example 1: View all materialized views under the default schema
Example 2: View all materialized views under a specified schema
Example 3: View all materialized views containing the word "test"
Example 4: Using IN and LIKE Parameters Together
Notes
- When using
LIKEandWHEREparameters, please ensure the filter conditions are correct to avoid returning empty results. - Please choose the appropriate parameters for the query based on actual needs to improve query efficiency.
