Skip to main content
Version: 2.5

SHOW MATERIALIZED VIEW

Description

Shows all or one specific asynchronous materialized view.

Syntax

SHOW MATERIALIZED VIEW
[FROM db_name]
[
WHERE
[NAME { = "mv_name" | LIKE "mv_name_matcher"}
]

Parameters in brackets [] is optional.

Parameters

ParameterRequiredDescription
db_namenoThe name of the database to which the materialized view resides. If this parameter is not specified, the current database is used by default.
mv_namenoThe name of the materialized view to show.
mv_name_matchernoThe matcher used to filter materialized views.

Returns

ReturnDescription
idThe ID of the materialized view.
database_nameThe name of the database in which the materialized view resides.
nameThe name of the materialized view.
rowsThe number of data rows in the materialized view.
textThe statement used to create the materialized view.

Examples

MySQL > SHOW MATERIALIZED VIEW\G
*************************** 1. row ***************************
id: 10099
name: order_mv
database_name: test
text: CREATE MATERIALIZED VIEW `order_mv` (`order_id`, `total`)
DISTRIBUTED BY HASH(`order_id`)
REFRESH ASYNC START("2022-09-01 10:00:00") EVERY(INTERVAL 1 DAY)
PROPERTIES (
"replication_num" = "3",
"storage_medium" = "HDD"
)
AS SELECT `order_list`.`order_id`, sum(`goods`.`price`) AS `total`
FROM `wlc`.`order_list` INNER JOIN `wlc`.`goods` ON `goods`.`item_id1` = `order_list`.`item_id2`
GROUP BY `order_list`.`order_id`;
rows: 3
1 row in set (0.02 sec)