Mysql数据处理-获取数据库所有表的唯一索引

121 阅读1分钟

select * from information_schema.statistics where table_schema='dev_science_4.2_lf' and non_unique=0 and (column_name like '%tenant_id%' or column_name like '%user_id%')

table_schema :数据库名 column_name: 筛选使用索引的字段 结果:

image.png