菜鸟EXPLAIN查看索引为空

MySql 码拜 8年前 (2016-05-16) 840次浏览
如图
菜鸟EXPLAIN查看索引为空
解决方案

40

插入数据后,就有实际的执行计划了:

mysql> insert into t_dept values(10,"xxx");
Query OK, 1 row affected (0.06 sec)
mysql> explain select * from t_dept where deptno=10;
+--+--+--+--+--+--+--+--+--+--+
| id | select_type | table  | type  | possible_keys       | key    | key_len | ref   | rows | Extra |
+--+--+--+--+--+--+--+--+--+--+
|  1 | SIMPLE      | t_dept | const | deptno,index_deptno | deptno | 5       | const |    1 |       |
+--+--+--+--+--+--+--+--+--+--+
1 row in set (0.03 sec)
mysql>

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明菜鸟EXPLAIN查看索引为空
喜欢 (0)
[1034331897@qq.com]
分享 (0)