网站首页 > 技术文章 正文
一、概述
索引是数据库中重要维护对象,下面分享一下收藏的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
- 最近发表
-
- 用Cursor开启JAVA+AI生涯_javascirpt怎么开启
- 大数据调度服务监控平台_大数据调度是什么意思
- SpringBoot、MyBatis、Vue搭建一个Java企业应用开源框架源码分享
- 大数据技术之Flume_大数据volume的含义
- Jenkins运维之路(Slave容器节点)_jenkins slave工作原理
- 程序员自救指南:IDEA 卡成狗?我的 9G 堆内存调参表让你起飞 附避坑
- JMeter:一个简单的测试计划怎么做?
- Windows 命令行终端 PowerShell 美化计划
- JDK25即将发布!新特性概览_jdk52.0
- JDK 25 新特性极简总结(2025 年 9 月 16 日发布,LTS 长期支持)
- 标签列表
-
- cmd/c (90)
- c++中::是什么意思 (84)
- 标签用于 (71)
- 主键只能有一个吗 (77)
- c#console.writeline不显示 (95)
- pythoncase语句 (88)
- es6includes (74)
- sqlset (76)
- apt-getinstall-y (100)
- node_modules怎么生成 (87)
- chromepost (71)
- flexdirection (73)
- c++int转char (80)
- mysqlany_value (79)
- static函数和普通函数 (84)
- el-date-picker开始日期早于结束日期 (76)
- js判断是否是json字符串 (75)
- c语言min函数头文件 (77)
- asynccallback (87)
- localstorage.removeitem (77)
- vector线程安全吗 (70)
- java (73)
- js数组插入 (83)
- mac安装java (72)
- 无效的列索引 (74)