试了一下
好像可以,还是会用index select * from ddd;
+------+
| id |
+------+
| NULL |
| NULL |
| NULL |
| NULL |
| |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 1 |
| 22 |
| 3 |
| 33 |
| 4 |
| 5 |
| 6 |
| 9 |
+------+
18 rows in set (0.00 sec)
mysql> explain select * from ddd;
+-------+-------+---------------+------+---------+------+------+-------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+-------+---------------+------+---------+------+------+-------------+
| ddd | index | NULL | idx | 11 | NULL | 18 | Using index |
+-------+-------+---------------+------+---------+------+------+-------------+
1 row in
mysql> drop index idx on ddd ;
Query OK, 18 rows affected (0.13 sec)
Records: 18 Duplicates: 0 Warnings: 0mysql> explain select * from ddd;
+-------+------+---------------+------+---------+------+------+-------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+------+---------------+------+---------+------+------+-------+
| ddd | ALL | NULL | NULL | NULL | NULL | 18 | |
+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)
set (0.00 sec)
好像可以,还是会用index select * from ddd;
+------+
| id |
+------+
| NULL |
| NULL |
| NULL |
| NULL |
| |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 1 |
| 22 |
| 3 |
| 33 |
| 4 |
| 5 |
| 6 |
| 9 |
+------+
18 rows in set (0.00 sec)
mysql> explain select * from ddd;
+-------+-------+---------------+------+---------+------+------+-------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+-------+---------------+------+---------+------+------+-------------+
| ddd | index | NULL | idx | 11 | NULL | 18 | Using index |
+-------+-------+---------------+------+---------+------+------+-------------+
1 row in
mysql> drop index idx on ddd ;
Query OK, 18 rows affected (0.13 sec)
Records: 18 Duplicates: 0 Warnings: 0mysql> explain select * from ddd;
+-------+------+---------------+------+---------+------+------+-------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+------+---------------+------+---------+------+------+-------+
| ddd | ALL | NULL | NULL | NULL | NULL | 18 | |
+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)
set (0.00 sec)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货