56,687
社区成员
发帖
与我相关
我的任务
分享
mysql> explain select * from test where uid not in(1014565,4197701,1896493,1086589,1004369,1071314,2969603,1017104,1003889);
+----+-------------+--------------+------+---------------+------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------+------+---------------+------+---------+------+-------+-------------+
| 1 | SIMPLE | test | ALL | PRIMARY | NULL | NULL | NULL | 66723 | Using where |
+----+-------------+--------------+------+---------------+------+---------+------+-------+-------------+
mysql> explain select * from t1 where id in (1,2,3,4,5,6,7,8,9);
+----+-------------+-------+-------+---------------+---------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref |rows | Extra |
+----+-------------+-------+-------+---------------+---------+---------+------+------+-------------+
| 1 | SIMPLE | t1 | range | PRIMARY | PRIMARY | 4 | NULL | 9 | Using where |
+----+-------------+-------+-------+---------------+---------+---------+------+------+-------------+
1 row in set (0.00 sec)
mysql>