如何查询和统计集群中的视图信息?
warning:
这篇文章距离上次修改已过1649天,其中的内容可能已经有所变动。
information_schema.views表中记录了视图的相关信息,如下:
select * from information_schema.views \G
*************************** 1. row ***************************
TABLE_CATALOG: NULL
TABLE_SCHEMA: testdb
TABLE_NAME: v1
VIEW_DEFINITION: select `testdb`.`t1`.`c1` AS `c1`,`testdb`.`t2`.`c2` AS `c2` from (`testdb`.`t1` left join `testdb`.`t2` on((`testdb`.`t1`.`c1` = `testdb`.`t2`.`c1`)))
CHECK_OPTION: NONE
IS_UPDATABLE: NO
DEFINER: root@%
SECURITY_TYPE: DEFINER
CHARACTER_SET_CLIENT: utf8
COLLATION_CONNECTION: utf8_general_ci
1 row in set (Elapsed: 00:00:00.00)