OceanBase MySQL 模式下怎么批量获取表的索引元数据信息

【 使用环境 】生产环境
【 OB or 其他组件 】OB
【 使用版本 】3.2.4

在MySQL中可以通过查询 information_schema 的表来获取元数据信息。但是在 information_schema.statistics 表中体现不了索引是全局索引global还是本地索引local。有没有地方可以获取到这个信息?除了show create table

information_schema.statistics 表和information_schema.partitions表联表查应该能查出你需要的内容

information_schema.partitions 只能体现出表是否是分区表。但是没有索引相关的信息呀

说过了,联表查。
相同table_name的,index_name<>‘PRIMARY’,又有partition_expression字段的不就是全局索引吗?
相反不就是普通索引吗?

partition_expression 指的是表的分区表达式,和全局索引有什么关联吗

用这个脚本可以查
select i.database_name,t.table_name,i.table_name,case i.index_type when 7 then ‘global_index’ else ‘local_index’ end index_type
from
(select database_name,table_id,table_name,table_type,index_type from oceanbase.gv$table i where table_type=5 ) i
join
(select database_name,table_id,table_name,table_type,index_type from oceanbase.gv$table i where table_type=3) t on i.table_name like concat(’%’,t.table_id,’%’);

我选择 show create table 后直接解析,联表查效率低