On Thu, 24 Jun 2004, MerchantSense wrote: > Seems ok to me... > > It seems to be checking all the rows in the explain for some reason too... > > mysql> show index from ip2org; > +--------+------------+----------+--------------+-------------+-----------+- > ------------+----------+--------+---------+ > | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | > Cardinality | Sub_part | Packed | Comment | > +--------+------------+----------+--------------+-------------+-----------+- > ------------+----------+--------+---------+ > | ip2org | 1 | ip_start | 1 | ip_start | A | > 2943079 | NULL | NULL | | > | ip2org | 1 | ip_end | 1 | ip_end | A | > 2943079 | NULL | NULL | | > +--------+------------+----------+--------------+-------------+-----------+- > ------------+----------+--------+---------+
mysql can only use one index from a particular table in any one query. So if you want to do a query that uses both ip_start and ip_end, you would need to create a multicolumn index on ip_start,ip_end or vice versa. What you have is one index on ip_start, and another on ip_end. So it can use one of the indexes, but then it has to scan each row that matches. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]