网站首页 > 技术文章 正文
一、概述
索引是数据库中重要维护对象,下面分享一下收藏的mysql索引查询语句
二、相关SQL
2.1 查询数据库中的所有索引
select index_schema,
index_name,
group_concat(column_name order by seq_in_index) as index_columns,
index_type,
case non_unique
when 1 then 'Not Unique'
else 'Unique'
end as is_unique,
table_name
from information_schema.statistics
where table_schema not in ('information_schema', 'mysql',
'performance_schema', 'sys')
group by index_schema,
index_name,
index_type,
non_unique,
table_name
order by index_schema,
index_name;
说明:
- index_schema - 索引模式(数据库)
- index_name - 索引的名称
- index_columns - 以“,”分隔的索引列列表
- index_type
(1) BTREE
(2) RTREE
(3)FULLTEXT
(4)HASH
(5)SPATIAL
- table_name - 表的名称
猜你喜欢
- 2024-11-19 MySQL常用的SQL提示
- 2024-11-19 MySQL 8.0-索引- 不可见索引(invisible indexes)
- 2024-11-19 数据库自学捷径-第七课 MySQL进阶-怎么提高搜索速度?索引
- 2024-11-19 Web端 SQL审核平台——Yearning Mysql
- 2024-11-19 MySQL性能管理及架构设计:SQL查询优化、分库分表
- 2024-11-19 深入浅出MySQL索引及优化分析,写出更高性能的SQL语句
- 2024-11-19 Linux运维面试sql语句
- 2024-11-19 图解MySQL:如何正确使用索引?
- 2024-11-19 看这篇就够了!MySQL 索引知识点超全总结
- 2024-11-19 SQL审核平台——Yearning Mysql
- 08-06中等生如何学好初二数学函数篇
- 08-06C#构造函数
- 08-06初中数学:一次函数学习要点和方法
- 08-06仓颉编程语言基础-数据类型—结构类型
- 08-06C++实现委托机制
- 08-06初中VS高中三角函数:从"固定镜头"到"360°全景",数学视野升级
- 08-06一文讲透PLC中Static和Temp变量的区别
- 08-06类三剑客:一招修改所有对象!类方法与静态方法的核心区别!
- 最近发表
- 标签列表
-
- cmd/c (90)
- c++中::是什么意思 (84)
- 标签用于 (71)
- 主键只能有一个吗 (77)
- c#console.writeline不显示 (95)
- pythoncase语句 (88)
- es6includes (74)
- sqlset (76)
- windowsscripthost (69)
- apt-getinstall-y (100)
- node_modules怎么生成 (87)
- chromepost (71)
- flexdirection (73)
- c++int转char (80)
- mysqlany_value (79)
- static函数和普通函数 (84)
- el-date-picker开始日期早于结束日期 (70)
- asynccallback (71)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- java (73)
- js数组插入 (83)
- mac安装java (72)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)