MySQL Forums
Forum List  »  Performance

Re: optimize IP range join: postgresql is 496 times faster
Posted by: keith cascio
Date: December 10, 2008 01:24PM

mysql> explain select count( r.id_country ) from addresses a join range r on a.address between r.begin_num and r.end_num;
+----+-------------+-------+------+-----------------------------+------+---------+------+--------+------------------------------------------------+
| id | select_type | table | type | possible_keys               | key  | key_len | ref  | rows   | Extra                                          |
+----+-------------+-------+------+-----------------------------+------+---------+------+--------+------------------------------------------------+
|  1 | SIMPLE      | a     | ALL  | NULL                        | NULL | NULL    | NULL |   2124 |                                                |
|  1 | SIMPLE      | r     | ALL  | PRIMARY,end_num_2,begin_num | NULL | NULL    | NULL | 105920 | Range checked for each record (index map: 0x7) |
+----+-------------+-------+------+-----------------------------+------+---------+------+--------+------------------------------------------------+
2 rows in set (0.00 sec)

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.