mysql查一张表有哪些索引
Posted 笨鸟居士的博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql查一张表有哪些索引相关的知识,希望对你有一定的参考价值。
可以用这个命令:
show index from table_name;
得到输出:
+------------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +------------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | table_name | 0 | PRIMARY | 1 | id | A | 661757 | NULL | NULL | | BTREE | | | | table_name | 0 | product_id | 1 | product_id | A | 661757 | NULL | NULL | | BTREE | | | +------------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 2 rows in set (0.00 sec)
以上是关于mysql查一张表有哪些索引的主要内容,如果未能解决你的问题,请参考以下文章