在 2010年11月9日 下午3:51,Johan De Meersman <vegiv...@tuxera.be> 写道:
> Indexes  typically only work on the left-hand-side. Rewrite as
> select * from ip_test where startNum <= 3061579775 and endNum >= 3061579775;
>

Thanks.

But this seems the same case happened:

mysql> desc select * from ip_test where startNum <= 3061579775 and
endNum >= 3061579775;
+----+-------------+---------+------+-----------------+------+---------+------+--------+-------------+
| id | select_type | table   | type | possible_keys   | key  | key_len
| ref  | rows   | Extra       |
+----+-------------+---------+------+-----------------+------+---------+------+--------+-------------+
|  1 | SIMPLE      | ip_test | ALL  | startNum,endNum | NULL | NULL
| NULL | 396528 | Using where |
+----+-------------+---------+------+-----------------+------+---------+------+--------+-------------+


And I'm sure the select can fetch records:

mysql> select * from ip_test where startNum <= 3061579775 and endNum
>= 3061579775;
+------------+------------+---------+----------+------+--------+
| startNum   | endNum     | country | province | city | isp    |
+------------+------------+---------+----------+------+--------+
| 3061514240 | 3061579775 | 中国    | 河南     |      | 联通   |


Please suggest, thanks again.

Regards.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to