码迷,mamicode.com
首页 > 数据库 > 详细

mysql查一张表有哪些索引

时间:2017-07-06 13:18:51      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:ack   sql   输出   blog   class   car   rom   --   card   

可以用这个命令:

 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查一张表有哪些索引

标签:ack   sql   输出   blog   class   car   rom   --   card   

原文地址:http://www.cnblogs.com/charlesblc/p/7125612.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!